Jira Workflow condition or validator on development panel

Robert G. Nadon
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 17, 2019

Hi all,

I have what I thought would be an easy one, but my head is sore from looking for an answer to this guy.  We are trying to build a workflow where if it is transitioned from "In Progress" to "Implemented" if the resolution is "Fixed" then there has to be something (anything really aka 'is not Empty'?) in the development panel.  

I do have script runner, and just about every other plugin out there lol. 

I have other items on if the resolution is Fixed so I know how to add that to a simple script, but I cannot find the development panel condition.

Thanks!

Robert

1 answer

1 accepted

1 vote
Answer accepted
David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 17, 2019

Hi Robert,

I'm not sure about ScriptRunner, but if you have JMWE, you can create a Scripted (Groovy) Condition or Validator (I assume Validator since you want to check the Resolution field) with this script:

issue.get("resolution") != "Fixed" || issue.get("Development").summaryBean.summary.repository.overall.count > 0

This will check that there is at least one commit - for other similar tests, you'll have to look at what else is in that field.

Robert G. Nadon
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 20, 2019

That would be great, but it does work.  Without any associated development panel it is not blocking the transition.

David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 20, 2019

You mean it does not work? When the resolution is "Fixed", it does not check the number of commits?

Robert G. Nadon
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 20, 2019

Apologies for my vagueness.  I have an issue and I put the above validator into JMWE script validator in the workflow on a transition.  And without any commits it allows it to transition.    But that was MY mistake!  So sorry.   It does work.  Thank you so MUCH!!!    

Robert G. Nadon
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 24, 2019

One more question is there something that only blocks if there is a commit?

The above will allow it to pass if there is just a pull request and not necessarily a commit.  It does pass with a commit as well. 

David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 24, 2019

If there's a pull request, there has to be a commit associated with it, no? Maybe what you want is to check if there is a commit in the master branch only?

Robert G. Nadon
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 28, 2019

OK, I'm good thanks.  I used Git a long time ago and am just the Atlassian admin who was asked to as a validator and so I am just asking what was asked of me.    "If there's a pull request, there has to be a commit associated with it," is the answer I needed. Thanks.

Lana Roljic - Cerkez
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 15, 2022

@Robert G. Nadon Can you please share example of script runner I would like to do something similar

Tenzing Doleck
Contributor
April 17, 2023

Hello @Robert G. Nadon  looking to add a script validator in wf  transition . Require fix version if PR exist in github  ( development field )  . any chance this was shared?

Santhosh Kumar Arogyaswamy
Contributor
May 28, 2024

Please try this :
issue.get("Development").summaryBean.summary.pullrequest.overall.count > 0

Suggest an answer

Log in or Sign up to answer