Forums

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

Questions about Lookup tables? And help with a load based ticket automation

Evan Kaung May 9, 2025

Hi all,

I've been asked to create a load based automation slightly different from the load based one that Atlassian currently offers.

Basically, the user wants the tickets to have a "weight" based on a field that they enter, called "complexity".

Weights are 1,3,5,etc.

They would also like the automation to not assign tickets to users if their ticket load is over 30.

I've been messing with jira smart values and jql summaries for a bit and was wondering what the best way to do this would be.

I'm currently stuck with a lookup table to reference all of the jql for the first user
pic1.png

the value is {{assignee = (firstuserid) AND "Complexity[Dropdown]" = Complex}}

This is the jql query that will tally how many work item issues are assigned to each user based on complexity, so that I can do the math for the weight load with it and not assign it to the user if the weight is above 30.

I've tested it to comment on the work item, but it says that the value is empty.

I've also tried it with the raw JQL but it just returns the string of the actual JQL instead (assignee = (firstuserid) AND "Complexity[Dropdown]" = Complex)

I think the jql I'm putting in might be wrong or might not be able to be parsed by the lookup table, but any help is appreciated thank you!

2 answers

1 vote
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 9, 2025

Hi @Evan Kaung -- Welcome to the Atlassian Community!

Without seeing your entire rule for context...I am not following how you are trying to use the Lookup Table.

When a Lookup Table is created, the Keys are static values and the Values can be static or dynamically determined at the time the table is created.  The Values must also use valid smart value (or plain text) syntax.  The syntax you are trying to set the table row's Values is both incorrect for a conditional expression and likely not what you seem to be describing.

 

Please show an image of your complete rule, in one single continuous image, and perhaps explain your scenario with an example work item and how the rule would process that.  Those will provide more context for the community to help.

 

Kind regards,
Bill

Evan Kaung May 13, 2025

Hey Bill,

Basically when the field "Complexity" changes value (manually by a user), and the issue is unassigned, the lookup table will automatically grab all of the agent's tickets and then see if the weight is over a number, at which point they will be assigned a ticket or not.

Right now it's just in a testing phase right now so it'll just leave a comment-

Screenshot 2025-05-13 095003.png

In the lookup table I'm trying to get the number of tickets that a user has been assigned with the complexity of a specific value. So for instance, assigned to John Smith and then a complexity of "complex" as an int.

Once that's done I'll do math with it to calculate the weight of the tickets to see if the user can be assigned a ticket or not but right now I'm a bit stumped on how to grab the number of tickets with that field assigned to the user with the conditional expressions on the table as it seems like it only does true/false statements.

Best regards,

Evan

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 13, 2025

The values for your Lookup Table are incorrect: they cannot dynamically lookup work items (formerly called "issues") for a user when the table is created.  Instead...

 

To get the work items assigned to the person who triggered the rule, first use the Lookup Issues action with JQL.  For example:

  • trigger: value changes for Complexity
  • condition: Issue is unassigned
  • action: lookup issues, with JQL of the following.  Please adjust to meet your scenario.
    • assignee = {{initiator.accountId}} AND statusCategory != Done

 

Then create your lookup table to count the values in the Complexity field for that user's work items, using the match() function to find them and the size function to count the matches.

Assuming the field's smart value is "complexity" and it is single-select, this would work.

  • action: create lookup table
    • name: varIssueCountByComplexity
      • row
        • key: Complex
        • value: {{lookupIssues.complexity.value.match("(Complex)").size}}
      • row
        • key: Detailed
        • value: {{lookupIssues.complexity.value.match("(Detailed)").size}}
      • repeat for other values...

Finally, use the table to get the counts for the trigger's issues Complexity value:

{{varIssueCountByComplexity.get(triggerIssue.complexity.value)}}

 

Like John Funk likes this
0 votes
Fernando Eugênio da Silva
Community Champion
May 9, 2025

@Evan Kaung , Welcome to the Atlassian Community!

 

I'm assuming that your complexity field is a select field for this case. This way, here how you need to use the lookupTable resource in the correct way.

 

Considering your table is called {{userIssues}}, your smartvalue to get the value considering the complexity reference should be: {{userIssues.get(issue.customfield_XXXX.value)}}

Change XXXX for the correct ID for the complexity field.

Using this you will able to get the value considering complexity reference.

Hope this helps you :)

Evan Kaung May 13, 2025

Hey Fernando,

Thanks for the help!

In this case I would need to grab the number of issues assigned to a specific user with that field being a specific value. Is there any way I can do this with smart values?

Looking at the documentation linked by Bill I can only see true/false conditional logic.

Best regards,

Evan

Suggest an answer

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

Atlassian Community Events