Forums

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

Jira automation craate table of linked issues

Alan Alder
Contributor
July 12, 2024

I'm trying to create a table within another field (acceptance criteria) using jira automation to display my linked issues however I can't get each issue to show on a new row.

Screenshot_20240712_224554.jpg

 

Screenshot_20240712_224536.jpg

1 answer

1 accepted

2 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.
July 12, 2024

Hi @Alan Alder -- Welcome to the Atlassian Community!

You are iterating over the issuelinks inside of the table row formatting.  Try moving the iterator outside of the row's conditional check.

For example:

*Delivers Tickets*
||*Ticket*||*Status*||
{{#issue.issuelinks}}{{#if(equals(type.inward,"delivers"))}}|{{inwardissue.key}}|{{inwardissue.status.name}}|{{/}}
{{/}}

 

Kind regards,
Bill

Alan Alder
Contributor
July 12, 2024

Thanks @Bill Sheboy  it's now put the record on the same row but different columns. Is there away to get them on different rows instead of columns

 

Screenshot_20240712_233230.jpg

Like John Funk likes this
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.
July 12, 2024

Oops...missing a newline after the conditional to trigger the new row.  I updated the earlier post.

Like John Funk likes this
Alan Alder
Contributor
July 12, 2024

@Bill Sheboy amazing thank you

Like # people like this
Alan Alder
Contributor
July 12, 2024

@Bill Sheboy if I wanted to show both delivers and depend on linked issues and then put the link type in the table how would I go about doing that?

Like John Funk likes this
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.
July 12, 2024

You could use the OR() conditional syntax, with two equals() calls, testing the different values.  Then add an additional column for the link type in the table.

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-conditional-logic/#or

 

Like John Funk likes this
Alan Alder
Contributor
July 13, 2024

@Bill Sheboy sorry to be a pain I'm still having issues keep getting errors. The delivers is an inward type and the depends on is an outward type.

 

Screenshot_20240713_105408.jpg

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.
July 13, 2024

The or() clause needs to wrap around the equals() tests for each type, as the equals() is what performs the test:

{{#if(or(equals(field, valueA), equals(field, valueB)))}}display when true{{/}}

 

Please note well: you are now mixing link directions in the expression, inward and outward links.  And so the logic to include the type, key, and status will need to be dynamic to use the correct one: inward versus outward.

I encourage you to experiment and get each type, "delivers" and "depends on", working separately and then try combining them.

Alan Alder
Contributor
July 14, 2024

@Bill Sheboy  how do I add the dynamic elements as I'm still getting errors with everything I try

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.
July 14, 2024

Please post the expression you are trying.  That will help to diagnose what is happening.

 

As an alternative to the dynamic elements, you may instead repeat the conditional blocks inside of the iterator.

{{#issue.issuelinks}}
conditional block to test for "delivers", and add a row
conditional block to test for "depends on", and add a row
{{/}}

This will also handle the case of adding the same issue twice in case it has multiple links to the same issue, but with different types.

 

Suggest an answer

Log in or Sign up to answer