How to get the comments from a lookup issue

vincenzo.spatafora
Contributor
October 16, 2024

Dear ALL,

is it possible with Jira Data Center to get the comments from a lookup issue?

I use Jira DC version 9,12,12.

Thanks, Vincenzo. 

2 answers

1 accepted

1 vote
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.
October 16, 2024

Hi @vincenzo.spatafora 

No, it is not yet possible.

For Jira Data Center, the Lookup Issues action only supports a limited number of fields: https://confluence.atlassian.com/automation/jira-smart-values-issues-993924860.html#Jirasmartvaluesissues-lookupissues-properties

There is a suggestion to add the other fields, which you may watch / vote for to see progress: https://jira.atlassian.com/browse/JIRAAUTOSERVER-877

 

There are two possible workarounds when you need to access other fields for a batch of issues:

When you only need to access the fields, and not edit another issue or perform branching, you may use the bulk-handling option with the plural {{issues}} smart value: https://confluence.atlassian.com/automation/run-a-rule-against-issues-in-bulk-993924653.html

When you need the results to edit another issue, or your rule already uses branching, you may use the Send Web Request action to call the REST API to search for the issues with JQL.  Then the web response may be used.

Kind regards,
Bill

vincenzo.spatafora
Contributor
October 17, 2024

Thank You Very Much @Bill Sheboy,

I'm amazed by your deep Jira knowledge.

You are more than a rising star.

Kind Regards,

Vincenzo. 

0 votes
Shawn Doyle - ReleaseTEAM
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 16, 2024

Hi @vincenzo.spatafora 

 

You'll want to use the smartvalues to grab the comments when using lookup issues.

{{#issue.comments}}
Comment by: {{author}} at: {{created}}
{{body}}
{{/}}

{{issue.comments.last.body}}
{{issue.comments.first.body}} - the body of the first of many comments
{{issue.comments.size}} - count of comments for the issue

{{#issue.comments}}{{#first}}First:{{author.key}}{{/}}{{body}}{{/}} - prints all of the comments and only prints the first author's key

https://confluence.atlassian.com/automation/jira-smart-values-issues-993924860.html

vincenzo.spatafora
Contributor
October 17, 2024

Thanks @Shawn Doyle - ReleaseTEAM.

That is working for the issue itself but what about if the issue is a result of the lookup function?

I understand from the above post that there is actually a limiltation as how many fields can be grabbed from the lookup feature.

Cheers, Vincenzo. 

Shawn Doyle - ReleaseTEAM
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 17, 2024

You would need to force the list of issues into a branch so that the issue had the focus for the smart values to work.

Suggest an answer

Log in or Sign up to answer