Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Lookup objects syntax

Wong December 20, 2022

I have the following query in the lookup objects in automation:  

objecttype = "Contact" and "Team" = {{"vAssignedTeam"}}

that works when the variable vAssignedTeam does not have a space in the name.  When the team has a space in the name, it does not return anything, can someone verify that my syntax is correct?

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.
December 20, 2022

Hi @WB 

If that is a variable, please try putting the quotation marks around the smart value instead:

objecttype = "Contact" and "Team" = "{{vAssignedTeam}}"

 

Kind regards,
Bill

Wong December 22, 2022

Hi @Bill Sheboy ,

   Thanks for the suggestion, I gave it a try and still does not work.  

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 22, 2022

Would you please post images of your complete rule and the audit log details showing the execution?  That may provide context for what you are seeing.  Thanks!

Wong December 23, 2022

I am hosted so can not export the log.  I split out the automation rule that is not working into a this simple manually triggered automation rule: 

image.png

Here's the Query:

image.png

Here's the log:

image.png

Here's the comment, you can see that the variable printed out "Network Services" while the lookup object returns nothing.

image.png

Here's the object it should've returned from the Asset schema:

image.png

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 23, 2022

Just to confirm, you are using Jira Cloud, correct?

Would you please show your Create Variable component in the rule?  That may explain what is happening with the lookup.

 

Next, I wonder: smart values are case-sensitive and I suspect the JSM objects are as well.  Perhaps change the lookup query to this:

objectType = "Team" AND "Name" = "{{vAssignedTeam}}"

 

And, after the lookup would you please write these two things to the audit log:

Number of objects found: {{lookupObjects.size|0}}
List of the object names: {{#lookupObjects}}{{Name}}{{^last}}, {{/}}{{/}}

The second one will list just the Names of any objects found, with a comma separator.

Like Raphael Lopes likes this
Raphael Lopes February 8, 2024

Does it only return 100?

0 votes
Wong January 6, 2023

Yes, we are cloud.  Using your suggestion to log the number of found, I was able to resolve the isssue.  It appeared that I just need to add a " " to my variable statement.  So, my original variable statement was: {{description.substringBetween("Team:",";")}}.  

This was changed to: {{description.substringBetween("Team: ",";")}}, with a space after Team:

This fixed my issue.  Thanks for your help in suggesting to log the object found.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events