Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

One of the most typical use cases for notification is when status is transitioning from A to B, say "To DoOpen" to "In Progress". Here's a small example on how to catch this and send a message to your users::

 

No Format
#foreach ($issue in $issues)
  #foreach ($item in $issue.lastchange.items)
    #if ($item.fromString == "To Do" && $item.toString == "In Progress")
        Issue $issue.key status is chagned to In Progress
    #end
  #end
#end

 

Note the use of pseudo-field "lastchange" here. This is an array of "items" that were changed during the last update to JIRA issue.

So we iterate through that list and see if there's a change to field called "status" and transition must be from "Open" to "In Progress". Only if we find such item then the content between "fields" will be rendered.

 

The screenshot below demonstrates how to achieve it:

Image Added

Note, that you can specify one or more "source"/"target" statuses or any status by picking "Any status".  

The notification will be processed if the actual issue status is transitioned from A to B and

1) A is in statuses list specified in FROM and B is in statuses list specified in TO.

or

2) A is in statuses list specified in FROM and TO is Any Status

or

3) FROM is Any Status and B is in statuses list specified in TO


You can also specify Project(s) to which this notification should be applicable as well as Issue type(s). When more fine-grained control needed you can also provide a JQL rule that the issue must match against

...

.