Have anyone tried to use the new post-function from JIRA Misc Workflow Extension plugin. I can't seem to get any of the groovy scripts to work. A simple example how to get a custom field value and put it in comment would be nice :)
Have you first tried putting a constant in the comment as a groovy script (e.g. "I'm here" - with the quotes)?
If that works, the you can move on to more complex Groovy. For example, getting a field value is as simple as:
assuming 12345 is the numerical ID of your custom field (you could also use the string ID of standard fields, such as "reporter").
Note that if your custom field is not a text field, you might need to extract the actual string value. For example, for a select field:
I've tried every option. When I type a costant string it works. But when a try to get a value from a field, there is no result. There are no ERRORs in jira log either. I've also tried both options below (used separately), but still no comment was generated.
OK, I found the problem.
For tests I've created a post-function to comment with groovy and after it I had the comment post-function with simple text in it. And it seems that the second one was overwriting the result of the first one. When I deleted the second one everything worked like you wrote in the first answer :).
I don't know if this should work like this, but thanks for your Help David :D.
Using Jira 6.1 and JMWE we have the following as a groovy expression for the comment
def msg = 'Resolved ' + issue.key return msg
which fails to add a comment. We also tried just a string
'Resolved ' + issue.key
also fails. But this
works. We also tried issue.getKey() and issue.get('key') all failed. How does one get the issue key? How does one get that inserted into a comment?
You need to use the technical field ID, which for Summary is, I believe, "summary" (lowercase s).
Hey Atlassian community, I help lead engineering at Sentry, an open-source error-tracking and monitoring tool that integrates with Jira. We started using Jira Software Cloud internally last year, a...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs