Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Jira Expressions: ScriptRunner: Not Allowing Ticket to Transition to Done

Rachael Axtman
Contributor
August 25, 2023

Hi Jira Community! 

This is the current code that I have with ScriptRunner in my workflow as a validator:

(issue["customfield_12400"] == "{}" || (issue["customfield_12400"].includes('state=MERGED')) && issue.fixVersions.length > 0) || (issue["customfield_12400"].includes('state=DECLINED'))

what it does is it looks at the Development custom field ‘state’ value to decide if someone can mark the issue as done. The current way it's written works in most of our use cases as we wanted it to say - you can mark your ticket as done if: The PR was declined, The PR was merged & has a fix version, or if there was nothing attached to this field.

We currently have an integration with GitHub and will be adding GitLabs too so this field is kind of the “out of the box” value.  What has happened is when there is multiple PRs AND it has state Merged AND Declined as the values our team members are not able to move their ticket to done. After digging in a little bit we realized that ‘state’ is getting removed in the API response during this use case. I would love any code suggestions or additions to what I have written to get it to work again.

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events