Comment issue in JIRA Misc Workflow Extension

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 :)

2 answers

1 accepted

1 vote
Accepted answer

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:


Hi David,

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.

Glad you found the problem. And, yes, you can create only one comment per transition.

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

'Resolved '

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?



I was strugling to print a combination  of text and values such as "<issue key> resolved"  but found the following working using "+" between each in the linked comment from the Misc Workflow

issue.get('issuekey')+" resolved"

You need to use the technical field ID, which for Summary is, I believe, "summary" (lowercase s).


Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 29, 2018 in Marketplace Apps

How to set up an incident workflow from the VP of Engineering at Sentry

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...

1,687 views 3 11
Read article

Atlassian User Groups

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!

Find my local user group

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

Groups near you