Forums

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

Using Automation - LookUp Tables to Set a Department, based on the assignee

Jared G
Contributor
November 8, 2024

 

 

As the title suggests, I am attempting to have our "Department" drop-down set using automation and a lookup table.  The automation is showing as successful; thus I am struggling to determine what's going on, and it is not working.  Here is a screenshot of my automation setup.  I've had to blur a few things for confidentiality so here's some clarifications:

Screen One - Look Up Table: For the key, I am using the individuals name.  I read it should be the user name, but I believe the first name last name is correct for this.  ie: John Smith is listed as John Smith (no dots or underscores).

Screen Two: The blured part is just the name of the company, then the word department.  It is a custom field.

The only thing I can think is that it doesn't work with a drop-down but I read that it should if the values match, which they do.

Thanks for the help!
J1.png J2.png

3 answers

1 accepted

2 votes
Answer accepted
Tomislav Tobijas
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 9, 2024

Hi @Jared G ,

You're on the right track but you would just need to change 2 things:

  1. The smart value (looking at the second screenshot and at <company> Department field) for getting value based on the key from the lookup table should include .get() function, where in the brackets you can use the assignee smart value
  2. assignee.username won't return anything as that parameter doesn't exist on the cloud. Instead, I believe you should use assignee.displayName if you don't want to use user ID value (which is unique for each user on the cloud)

Anyway, here's an example of how this should look like:2024-11-09_10-42-40.png

So you can just use the following syntax (that's based on your example):

{{assigneeDepartment.get(assignee.displayName)}}

On another note, I would suggest using Log action when testing automation rules as this action is quite helpful when trying to debug things. Then you can easily navigate to rule Audit log (once the rule has been executed) and check what has been written in the log - e.g. I've used it to see if it will return anything for {{assignee.username}} smart value.

2024-11-09_10-44-58.png

Hope this helps.

Cheers,
Tom

Tomislav Tobijas
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 9, 2024

Additionally, I've tested it with the exact example you're looking at - the one where, in my case, the field Select List (single choice) is in fact a dropdown field, and you can use option names as values in the Lookup table and not necessarily the option IDs.

0 votes
Tomislav Tobijas
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 12, 2024

Hi @Jared G ,

Regarding your previous question, and when looking at the following:

J2B.png

I think you got everything right up to this smart value {{IssueTypeWorkType.get(...)}}.

Basically, with .get(issue.customfield_10360) you're referring to the same custom field on which you want to set up the value.

Considering keys in the Lookup table are issue type names, what you would like to do is to get an issue type name (of the created issue) and then get the value mapped to it within the table.
So, get the issue type name > find the value mapped to that key and set that value in the custom field.

To sum it up, from what I can see here, the smart value for that Work Type field should be:

{{IssueTypeWorkType.get(issue.issuetype.name)}}

image140.png

Cheers,
Tom

Jared G
Contributor
November 13, 2024

Hey Tom, this did work, and the explanation helps me wrap my head around the automation concept!  Your help is much appreciated!!  I have a few more of these to setup, so I'll return if I can't quite get there.  Thanks again!

Like • Tomislav Tobijas likes this
0 votes
Jared G
Contributor
November 12, 2024

Hi Tomislav,

Thank you very much.  I really appreciate the screenshots, explanation, and added tip.  I'll certainly begin to add in the log check, which I have for a follow up question;

I'm struggling to create the same reaction for a similar setup.  The setup is essentially to do the same as the assignee automation, but this time, to set a custom field titled "Work Type" (custom field ID 10360), based off the issue type.  I'm not sure what the best trigger is, so I just did Issue Created.  Here is the setup:

J1B.png J2B.png   

The error log picks up the issue type name just fine, so I'm thinking the final screen, with the custom field variable is to blame.

any extra help is appreciated!

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