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
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.
That would be great, but it does work. Without any associated development panel it is not blocking the transition.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You mean it does not work? When the resolution is "Fixed", it does not check the number of commits?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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!!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Robert G. Nadon Can you please share example of script runner I would like to do something similar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please try this :
issue.get("Development").summaryBean.summary.pullrequest.overall.count > 0
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.