I'm in process of migrating a Jira server instance to Jira cloud and would like to move as many ScriptRunner items as possible.
In the server version, I have a workflow condition using Groovy that checks for a changelog with the field='status' and the toValue='To Business Analyst'.
The changelog is checked only if one of our user picker custom fields (Business Analyst) has a value.
If the Business Analyst contains a value and there's no log record of the issue status being changed to 'To Business Analyst', the workflow condition will return false.
In the Jira Expression, I have the check for the Business Analyst value and a check to see if there are existing changelogs. These seem to work fine:
issue.customfield_10041 != null &&
issue.changelogs.length > 0
I can test values in the changelogs as well:
issue.changelogs.filter(c => c.author.displayName == 'Jim').length > 0
Full disclosure, I don't typically do Web development but have been provided an 'opportunity' by having to convert the scripts.
Any help would be appreciated.
Hi @Jim Litzie
Thank you for your question.
I can confirm that the ScriptRunner for Jira Cloud plugin provides workflow Validators using the Jira Expression Framework as documented in the Atlassian API documentation page located here or in the documentation page located here which explains how to add in a new validator to your workflow.
We can confirm that when viewing the Jira Expression Framework API documentation page linked above you can navigate to the Context variables section which shows what variables are provided by this framework that can be used to create the expression.
If you then click on one of the variables it will show all the properties that can be called on the variable for the expression such as for the issue variable as shown here and you will be able to check this to see if Atlassian provides a variable that contains the item you want to check against.
We would recommend using these documentation pages linked above as a reference guide to help to create the validator expression that you require.
We are excited to announce the open beta program for self-hosted runners. Bitbucket Pipelines Runners is available to everyone. Please try it and let us know your feedback. If you have any issue...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events