Set condition to run automation with only value match with lookup table

Nguyen Thanh Tien
Contributor
December 9, 2024

I created an automation rule to update the Slack user ID in Jira tickets as follows:

  • The rule triggers every time an issue is assigned.
  • I defined 'slack user' using a lookup table with keys (Jira user IDs) and values (Slack user IDs).
  • If the 'assignee ID' matches a 'slack user ID' in the lookup table, the field is updated accordingly. If there’s no match, it currently changes to "none."

Is there a way to set a condition so that the automation only runs when there is a value match in the lookup table? In other words, if there's no match, it shouldn't change to "none."

Note: I’d like to optimize this rule to reduce my automation usage count.

iScreen Shoter - Google Chrome - 241210095850.jpg

2 answers

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.
December 10, 2024

Hi @Nguyen Thanh Tien 

Based on the rule image you show, there are several ways to do this:

  1. Use a simple smart values condition to check if the get() call returns anything, and only then perform the edit.  This approach will only perform the edit when needed.
  2. Use an inline condition with the format {{if(smartValue, "value if true", "value if false")}} to always edit the field, setting it back to the original value when one is not needed.  This approach will always update the field, even when not necessary.
  3. Expand the lookup results into a text expression, using the entries function, and use smart value, list filtering to find the value needed, with a default of the current field value.  This approach will always update the field, even when not necessary.

 

I hypothesize there is another rule which uses the Feedback Slack User ID field to send messages.  Please consider: what should happen when the Assignee is not found for sending that feedback?  For example: 

  • Notify someone to add the user to the lookup table in the rule
  • Add an indicator so the Slack messages are not sent
  • Send messages to the user currently assigned to the field
  • Something else?

 

Kind regards,
Bill

Nguyen Thanh Tien
Contributor
December 13, 2024

@Bill Sheboy It seems the first way meets my need. However the automation isn't working for both scenarios: match and no match (between 'assignee ID' and 'slack user ID'). I've attached the condition I've added. Could you please advise?iScreen Shoter - Google Chrome - 241213171642.jpg

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.
December 13, 2024

First, your rule steps are out of order: the condition should be after the table is created!

Next, there is a typo in your condition you highlighted: there is an "a" before the issue smart value.

Finally, I believe you want the condition to be "not equals" empty, thus the rule continues to run if a value is found with the get() call.

0 votes
Chris Rainey
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 9, 2024

Hi there,

May I suggest adding an IF/ELSE condition after the create lookup table action. Pair that with a smart values condition in the "If matches" branch and I think that may get you what you're looking for. 

Nguyen Thanh Tien
Contributor
December 13, 2024

@Chris Rainey  Thank you for your suggestion! Could you please provide more specific guidance on how to implement the IF/ELSE condition after the create lookup table action?

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