I would like to set up a Merge Check that will block a merge if the associated Jira Issue has any blocking tasks.
I have searched for the solution before coming here and found the following example. However, right at import com.atlassian.jira.component.ComponentAccessor I get an "unable to resolve class" error. I am running the latest version of Scriptrunner for Bitbucket Server v.7.10.0.
I have attempted to use AppLinks as shown in the following example and see that I am able to access the Jira Api this way, however I am unsure of how to actually determine the Task Id of the issue linked to the triggering Merge Branch.
I am having a hard time finding any up to date documentation that doesn't involve random Adaptavist or Atlasian forumn posts. Does anyone have any insight for how I can get started?
The ComponentAccessor is no longer supported, and my non-descript errors were a result of lower permissions. Once being promoted to admin I was able to access the Script Editor window which allowed me to perform the following...
To replace the provided "Is Blocked on Jira" example I instead created a Jira Issue Controller class that is responsible for accessing the information using appLinks and Jira API calls.
This class returns a custom object
RestObjects.JiraIssueI use to parse the specific API response Map into custom Classes. A short example of the JiraIssue class and how I am able to access the linked blocking issues is shown below.The rest of this class uses nested classes to parse the input Maps for their fields into usable objects. It also contains objects/functions I have created for my specific application.
I hope this answer is helpful to someone, the documentation on ScriptRunner for bitbucket is limited.