Creating automation to update several fields using reporter's email address or user name

gloria pechacek May 26, 2024

Hi Everyone,

Could you help me with an automation to use the "reporter" when an issue is created to label several fields for a project? 

I was exploring using the "create lookup table" but not sure if I'm on the right track.  

Example.  

When report  Gloria@abc.com sends in a ticket the rule would either look at the lookup table or some other source to find that the labels on Division = Corp (choice in the Division field) and Agent office = TX-Corporate (choice in the agent office field).

Thank you! 

 

image.png

 

image.png

4 answers

0 votes
gloria pechacek May 28, 2024

Ok. I'll work on it.  Thank you.  

0 votes
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 28, 2024

If this is a single-selection field, please see the example I noted.  Your lookup table rows could be something like this:

Key  Value 
 alice@domain.com STC 
 bob@domain.com Corp 
 eve@domain.com MODE
and so on...  

 

Please look here to see more examples for using Lookup Tables: https://community.atlassian.com/t5/Automation-articles/Update-Create-lookup-table-action-improvements/ba-p/2427798

 

0 votes
gloria pechacek May 28, 2024

Hi Bill,

I can keep it under 200.  

I have 4 choices under division, could you help with the syntax for the below?

Division = STC, TTS, MODE or Corp

0 votes
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 26, 2024

Hi @gloria pechacek 

How many different user email addresses and matches do you need to set the fields: just a few, many more, or more than 200?

  • If you have more than 200, that cannot be solved using Lookup Tables as that is the maximum number of rows
  • If you have only a few, such as less than 5 entries, you could use either if / else conditions or lookup tables
  • For the other counts, lookup tables may work

When using the lookup tables, consider making a table for each field, and then edit the custom, selection fields.  If these are multiple select fields, you will need to use advanced edit with JSON instead.

For example:

  • trigger: issue created
  • action: re-fetch issue (The Issue Created trigger can fire so quickly the issue data may not be available to the rule yet.  The fix for that is to always add the Re-fetch Issue action immediately after this trigger type.)
  • action: create lookup table for Division values
    • name: tableReporterToDivision
    • add rows where the key = the reporter email address in lowercase and the value is the Division.  Forcing the value to lower case will help with matches later if the user changes their email address.
  • action: create lookup table for Agent Office values
    • name: tableReporterToAgentOffice
    • add rows where the key = the reporter email address in lowercase and the value is the Agent Office.  Forcing the value to lower case will help with matches later if the user changes their email address.
  • action: edit issue
    • select the Division field, and enter this for the value
      • {{tableReporterToDivision.get(issue.reporter.emailAddress.lowerCase())}}
    • select the Agent Office field, and enter this for the value
      • {{tableReporterToAgentOffice.get(issue.reporter.emailAddress.lowerCase())}}

 

What do you want to happen if the reporter is not found in the lookup tables?  You may want to alter your rule to handle that case.

 

Kind regards,
Bill

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events