Skip to end of metadata
Go to start of metadata

Very often (60% of all use-cases to be precise) you want to receive a notification when

  • Status is changed from A to B
  • Issue priority is changed from A to B
  • Another Issue standard or custom field is changed from A to B

 

With Jirassimo you can receive this notifications, it just requires some configuring. Your starting point is to create a new messenger with

JIRA Event:    issue updated

JQL rule:       project = YOUR_PROJECT_KEY

The second condition is not mandatory, but highly recommended to keep things under control in scope of a single project.

 

Now we need to create a message template that will notify your user about the change in XXX. Remember the "most important rule" in Jirassimo:

If message template evaluates to empty then no message will be sent out


This is exactly what we need to make sure that messages will be sent only when they match predefined condition in our template, but how do we write a condition properly, so that it will be non empty when the respective field is changed and empty for all other issue updated events? As usually, picture is better than thousands of words, so here you go:



There are two sections of Issue fields code. In the top we describe a condition by checking first if $issue.last_change field exist. If so, we're iterating all $issue.last_change.items that were changed. And if the $item.field equals to "Status" then we render the message. Here's the source code for you convenience.


So far, so good, but let's say you need to track the Status change from "In Progress" to "Done". For that, we need to track two variables "fromString" and "toString" like in the following example:


As you can see from the examples above, it all boils down to checking value of $item.field and optionally $item.fromString and $item.toString if you need more fine-grained control. But how would you know precise value of $item.field to compare against? There's a simple way to do that. Just change the field you're interested in in your testing issue and open that issue in Jirassimo fields navigator as shown below:



Expand issues->issue->changelog->histories (first item) -> items -> item and you'll see there the name of your field that you've just changed, it's original value and new value.

  • No labels