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

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,551,873
Community Members
 
Community Events
184
Community Groups

How do you lookup an issue using one of the ticket components?

Hi, I am trying to perform the following:

1. Take an existing Component on the ticket and perform a search with it. This component can be found with something like: {{issue.components.name}}

2. Search this component using JQL. Similar to this:

component = ADMIN order by created DESC

 

3. Post the results in a comment

I believe the searched data can be found using {{lookupIssues}}

 

I'm running into an issue with the JQL logic and am unable to search for the following:

component = {{issue.components.name}} order by created DESC

 Does anyone have suggestions on how to perform this component search using the components from the issue?

2 answers

1 accepted

0 votes
Answer accepted

Since my search was across multiple Projects, I was able to resolve this by getting Admin access to Jira and creating a Global Rule that allows me to search in both of my desired projects.

1 vote
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Apr 14, 2023

Hello @Aqib_Shirwani 

Can you please show us your entire Automation Rule? Also please show us the results of the rule execution that are recorded in the Audit Log.

When asking for help with an Automation Rule we really need to see that information. Often a problem in an automation rule is caused by the context under which the step is running.

Do your issues ever have more than one Component value? The Components field is a multiple selection field, so it is possible for there to be more than one value there. What would you expect to happen if there was more than one value?

If you look at the documentation for the smart value for Components you'll see that it returns the values that are in the field. You are getting a list of values.

To accommodate getting a list of values you need to change your JQL to

component in ({{issue.components.name}})

Hey @Trudy Claspill 

I've attached my automation below.

The Create Variable part was just me testing something out - I can remove it.

 

In the JQL of the lookup, I tried the lookup with the following:

  • {{issue.components.name}}
  • ({{issue.components.name}})
  • '{{issue.components.name}}'

jiraAutomationTest.png

This is how I'm displaying the values from the Lookup:

image.png

Here's what the logs displayed:

image.png

 

Thank you for your suggestions for multiple components. I will change the JQL as such: component in ({{issue.components.name}}). 

Any idea why the lookup is always displaying no issues?

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Apr 17, 2023

Are you saying that you are trying to display the issues found by the Lookup Issues action within the comment you are adding, and it is there that nothing is displayed?

If so, then what you have added to the comment is not correct for displaying all the issues that were found in the action.

If you look at the documentation for the Lookup Issues action it provides you with the correct syntax for display information (in the example it displays the issue key) for each issue in the results set.

 

{{#lookupIssues}} 
* {{key}}
{{/}}

Suggest an answer

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

Atlassian Community Events