Structure for Jira formula: How to show information depending of a linked issue

aedu
Contributor
March 12, 2022

Hi all

I want to flag Issues in a Formula-column based on information from a linked Issue.
My formula does not raise any errors, but doesn't show up any information either.

Here is the theoretic relationship:
Rel1: Issue A is linked to Issue B with  link L1
Rel2: Issue A is linked to Issue C with link L2
Rel3: Issue B is linked to Issue C with link L3

Challenge:
If Rel3 exists i want to Flag Issue A

 

Code:
WITH parent_config = issuelinks.FILTER($.type = 'Deployment' AND $.destination = this).MAP($.source):
WITH
linked_domain = issuelinks.FILTER($.type = 'Publishing' AND $.destination = this).MAP($.source):
/*
REL-250 is deployed by REL-209 (via Link Deployment)
REL-250 is published by REL-251 (via Link Publishing)

concat(parent_config,",",linked_domain)
response for REL-250: REL-209,REL-251

REL-209 deploys REL-250 (via Link Deployment)
REL-209 rebuilds REL-251 (via Link Domain)

REL-251 is rebuilded by REL-209 (via Link Domain)
REL-251 publish REL-250 (via Link Publishing)
*/

IF parent_config.issuelinks.FILTER($.type = 'Domain' AND $.destination = linked_domain): "(flagoff)"

 formula.png

2 answers

2 votes
Dave Rosenlund _Trundl_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 24, 2022

@aedu  Let's try a different approach.  Drop the Formula folks at ALM Works an email via structure@almworks.com asking for a use case discussion.  

That way the team can ask questions to help us fully understand your use case(s) and propose solutions based on ideas or techniques that can't be easily identified in this kind of exchange.  I.e., a more collaborative approach. 

I hope you take us up on the offer.

 

-dave 

2 votes
Nicholas Ellis _ALM Works_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
March 14, 2022

Hi Aedu,

Unfortunately I do not think this is possible.  There is a limit to how far outside the current context you can pull in data with Expr.  We can generally think of the context as the current issue, let's say issue A.  From here we can access A's links, which in your example would be both issues B and C.  However this is as far as we can go, out one level of linking.  This means we cannot check B's or C's links to see if they are connected.

More specifically the reason the code above does not work is because parent_config is an array of source issues, taken from issue_links.  Those source issues do not have issue_links available, only the current rows links are in context.

Cheers,
Nick
[ALM Works]

aedu
Contributor
March 15, 2022

ok - thanks for your reply.

Like Dave Rosenlund _Trundl_ likes this
Dave Rosenlund _Trundl_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 16, 2022

Thanks for asking, here on the community, @aedu — so others can benefit from this discussion 👍🏻

-dave 

aedu
Contributor
March 22, 2022

Hi ALM Works Team

I'm trying to achieve my challenge with a different approach.
If I have an Issue (CFG-8) 2x in the Structure: 1st beneath REL-209 and 2nd as a child of a sibling (CFG-6), then it should be possible to remove the 1st occurrence with a S-JQL filter?

How should the S-JQL query look like?

s-jql-query.png

cheers, aedu

Like Dave Rosenlund _Trundl_ likes this
Nicholas Ellis _ALM Works_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
March 24, 2022

Hi Aedu,

Unfortunately this is not possible either.  The "self not in ..." syntax expects a JQL query after like so:

self not in [assignee is empty]

It cannot be used to compare two different issues in the structure.  Descendants works the same way expecting a JQL query block after.

Cheers,
Nick
[ALM Works]

Like Dave Rosenlund _Trundl_ likes this

Suggest an answer

Log in or Sign up to answer