Hi! I am looking to create the following with Script Runner Cloud:
I am also looking to create the following validator:
Hi @Rachael Axtman ,
For the first case you'll want an expression like this
issue.comments.filter(c => c.body.plainText.includes("test") ).length > 0
Depending on how exact you want to match, you could also use .match() with a regular expression.
As for the second case, that's even easier you just need to know the custom field's id. Your validator could then look like this:
issue.customfield_10005 != null
There is a pretty good documentation for Jira Expression here.
Hope that helps, Oliver
Oliver,
For the custom field is there a way for me to write something to detect status of a PR?
The code you wrote on the first answer looks pretty close to what I came up with yesterday. Thanks again!
-Rachael
Hi @Rachael Axtman
I had to poke around a bit and I am still not 100% sure it will work the same with Github, but here's what I found:
issue["customfield_10000"].includes('state=MERGED')
It's not really all that well documented, but it seems like the information from the "Development" field is always in the custom field with the id 1000. Unfortunately, the content of that field is not syntactically correct JSON, so you cannot just parse it with JSON.parse() and look at the different attributes.
However, you can look for the corresponding "state=MERGED" string, which should work pretty well.
Best regards, Oliver
Thank you!
It looks like you're new here. Sign in or register to get started.