Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Lookup objects syntax

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.
Dec 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

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.
Dec 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!

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.
Dec 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.

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