Use custom field in JIRA Automation plugin rule

Arbak Martirosyan June 4, 2018

Hi, 

 

I've installed Jira Automation lite plugin in Jira cloud and now we want to do a specific action: 

- Change assignee to custom "Reviewer" field value when specific status transition is triggered. 

- Change assignee to Reporter, if no Reviewer is specified. 

 

I assume first rule should be Issue transitioned, but that applies to all statuses. How can I specify specific status transition in the first step and execute command using custom fields in new condition step? 

2 answers

1 accepted

1 vote
Answer accepted
John McKiernan
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
June 4, 2018

Hi Arbak, 

There is an easy enough way for Automation for Jira to do what you need. 

I have attached a screenshot which walks you through the steps. (Just keep in mind that I have used the field 'Approvers' instead of 'Reviewers' in the example as this is your custom field. 

Let me know if this works for you or if you have any further questions!

Cheers,

John 

Screenshot 2018-06-05_14-43-36.png

Arbak Martirosyan June 6, 2018

Hi John, 

Thanks a lot for your answer! This is exactly what I was looking for, and here's how I configured it in our case. 

Screen Shot 2018-06-05 at 11.27.54 AM.png

 

status = "10103"

This is "In review" status ID. However, for some reason it conflicts with some other rule that we have in automation. 

This rule states that whenever assignee of the issue is changed, status should change to "NEW". I've added != condition for issues with "In review" (10103) status, so that it won't conflict with the rule above. However, there're cases when issues are left unassigned, or transition to "NEW" status even from "In review". What do you think may be the reason?

 

Screen Shot 2018-06-07 at 10.49.26 AM.png

John McKiernan
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
June 7, 2018

Hi Arbak,

Glad to see we are close!

There are two changes I will suggest. 

1) First - I would try and set the rule up similar to my screenshot (below). 

Screenshot 2018-06-08_10-03-11.png

2) Also if you don't need this rule to be triggered by another rule, make sure you untick the box in your 'Rule Details' (see screenshot). 

 

Screenshot 2018-06-08_11-54-39.png

 

Let me know how you go!

Cheers,

John 

Arbak Martirosyan June 8, 2018

Hi John, 

There are 2 more statuses that should be excluded from the rule. If I do it with your approach, should I add 2 more "If: Compare 2 values" conditions?

Also seems that issues lose assignees when issue type is "Bug". I don't seem to find a way to create rule for specific issue types, shouldn't the base rule cover all? 

 

thanks!

John McKiernan
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
June 11, 2018

Hi Arbak, 

Yep - exactly right with regards to your first question. You can add two more conditions. (You can either use the 'compare two values' condition or the 'Issue matches JQL'

If you want to keep your rule that bit cleaner, you could use the Else / If block which will enable you to use multiple conditions in one. I have attached a screenshot to give you an idea of what I mean. 

Secondly, if you want to create a rule for specific issue types, all you need to do is add a condition to check the issue type so it only executes on the issues you want. I have also included a sample of this in the second part of the sample rule screenshot. 

Hope that helps but let me know if you have other questions!

Cheers,

John 

Screenshot at Jun 12 15-19-11.png

Arbak Martirosyan June 14, 2018

Hi John, 

That's great! It answers all of my questions. 

 

Big thanks to you for help :) 

0 votes
Marcos PS [DEISER] June 4, 2018

Hi Arbak,

In my opinion, the best way to reduce the scope is using custom events, create a new event based on "Generic Event" template and then replace in the desired transition the post-function generic event for the one you have created. Then, automation can be triggered when the specified event has been fired (Multiple issue events rule) instead of on issue transition.

You have several ways for implementing the conditioned behavior in order to set the assignee value, you can use ScriptRunner to add a custom script post-function or create a custom script listener together with the custom event (in this case you can remove the automation rule implemented before), you also can create multiple automation rules properly conditioned, etc.

Regards,

Marcos.

Suggest an answer

Log in or Sign up to answer