Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Prevent automation rule from assigning "Jira Automation" as "User who triggered event"

Federico Varchavsky
Contributor
January 16, 2023

Hello, 

 

I'd like to add code to an automation rule in order to detect that the user that will be assigned will Jira Automation and in such a case leave the User Assigned field unmodified.

 

Thanks!

3 answers

1 accepted

4 votes
Answer accepted
Ste Wright
Community Champion
January 16, 2023

Hi @Federico Varchavsky 

Just to confirm the need here...

  • You have an Automation Rule, which can be triggered by human users, and the "Automation for Jira" account
  • The Assignee gets set during this rule to the User who triggered the event
  • You want to avoid this being set to "Automation for Jira"

...is this correct?

---

You could add a User Condition to achieve this?

The parameters would be:

  • User = User who triggered the event
  • Check to perform = is not
  • Criteria = Automation for Jira

This would stop the rule from executing the Action if the user who triggered the Automation Rule is the "Automation for Jira" account.

---

If there's multiple actions, not just Assign Issue happening - you could also consider:

  • Using the If/Else Block Condition, to have multiple outcomes.
  • Using the above User Condition in one IF/ELSE-IF branch, and the reverse of it (i.e User who trigger the event is Automation for Jira) in the other
  • Having different Actions in each branch, depending on who the trigger user is

---

If these don't fit into your wider rule, could you provide us some more specifics about what the rule does and how it operates? A screenshot would be very beneficial in this scenario.

Or if it isn't what you need, let us know so we can assist further :)

Ste

Federico Varchavsky
Contributor
January 16, 2023

Hi Ste, 

Thanks for the prompt response.

 

I did the following and tested it in a test project and it seems to work:

 

-Added an If/Else block to the rule

---Check if the User who triggered the event IS NOT  "Automation for Jira"

-------Then go ahead and Assign

 

So, if the user that's going to be assigned would be Automation for Jira, then rule stops without assigning it.

 

Thank you all!

Federico.

Like Ste Wright likes this
0 votes
Alex Koxaras -Relational-
Community Champion
January 16, 2023

Hi @Federico Varchavsky 

It's not quite clear what you want to accomplish. I mean you want the rule that you will create to see if the assigned user is "Jira Automation"? And if this is the case then leave the assignee field unmodified?

Or you want to change the actor of the rule as Rilwan suggests?

Federico Varchavsky
Contributor
January 16, 2023

Thanks for the question Alex.

Above is how I solved it.

 

To answer your question, I wanted to have the rule assign whomever triggered the event unless the user who triggered the rule is Automation for Jira. :)

 

Have a great day!

Federico.

0 votes
Rilwan Ahmed
Community Champion
January 16, 2023

Hi @Federico Varchavsky ,

Jira/Site admin can add  other users as Rule actor. Steps are mentioned in https://support.atlassian.com/cloud-automation/docs/run-jira-rules-as-another-user/

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events