how to get the "Smart value" working in automation

Mimi Peters March 22, 2023

Hi there,

I got this auto rule set up the idea is to auto-label the Department base on users. Instead of creating multiple rules, does anyone manage to only use one rule to achieve this?

temp.jpg

my smart value is like this but did not work out.

{{#user_is_in_group(Contact Center)}}CSC{{/user_is_in_group}}\n{{#user_is_in_group(Fraud Team)}}Fraud{{/user_is_in_group}}\n{{#user_is_in_group(CDD Team)}}CDD{{/user_is_in_group}}\n{{#user_is_in_group(Global Fraud Team)}}FO{{/user_is_in_group}}\n{{#user_is_in_group(Asia Compliance)}}ACOM{{/user_is_in_group}}

2 answers

1 accepted

0 votes
Answer accepted
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.
March 22, 2023

Hi @Mimi Peters 

I believe you will need to use if/else conditions for each group, as I do not believe there is a rule function as you show for user_is_in_group()

Your rule could be like this:

  • trigger: issue created
  • action: re-fetch issue (To confirm the data is fully loaded after the create)
  • if/else condition:
    • user condition: reporter is in Contact Center
    • action: edit issue to set the Department to CSC
  • else/if:
    • user condition: reporter is in Fraud Team
    • action: edit issue to set the Department to Fraud
  • ...and so on

 

The limit to this technique is a rule can only have around 60 components, and so if you have more than 20 groups this may not work.

 

Kind regards,
Bill

Mimi Peters March 22, 2023

Thanks Bill, so you mean I can have do a format like below and just keep add else/if up to 20 combinations?

  • if/else condition:
    • user condition: reporter is in Contact Center
    • action: edit issue to set the Department to CSC
  • else/if:
    • user condition: reporter is in Fraud Team
    • action: edit issue to set the Department to Fraud
  • else/if:
    • user condition: reporter is in CDD Team
    • action: edit issue to set the Department to CDD
Like Bill Sheboy likes this
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.
March 22, 2023

Yes, that sounds correct.

I added a re-fetch after the trigger as a precaution.

Mimi Peters March 24, 2023

Thanks Bill, it works perfectly :) 

Like Bill Sheboy likes this
0 votes
Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 22, 2023

Hi @Mimi Peters 

I think that you should use conditional logic to achieve what you want:

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-conditional-logic/

However I haven't tried it out to be honest, but I don't see any reason not to be feasible.

Mimi Peters March 22, 2023

Hi Alex, I have read though but would not know how to create one that works hence posting here. Lots of articles reference is doable but I have not find a way to get it working.

Suggest an answer

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

Atlassian Community Events