JIRA email notification - Get Issue Status

Hello - 

I am currently working on custom email notifications via post functions. In my notifications I have simple Groovy scripts that show different fields for the Issues. 

What I am trying to do is show the current status of the Issue on the email notification. To show the status I have:

$issue.status.name

This works correctly when I create the Issue. The status is shown in the email is correct. However, when I transition the Issue, the status on the next email notification does not change. The status does update on the second transition, and throughout the rest of the workflow. Therefore the current status in the email notification is always one status behind where the Issue currently is. 

Does anyone know a work around for this? Is there a way I can manipulate the Groovy script to add a +1 to the status? Any help would be much appreciated.

Thanks in advance. 

1 answer

0 vote
Claudio Ombrella Community Champion Jan 24, 2018

When do you run the script? Before or after changing the status? I suspect that your triggering the script before the workflow transition step. Put a screenshot here so we can give a look. 

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Asked 4 hours ago in Confluence

What are the resources that you use to learn more about Atlassian Products?

I am gathering information about resources available for Atlassian product knowledge transferring for a presentation in our local Atlassian User Group. I want to group them in four categories From ...

35 views 3 3
View question

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