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

JIRA Structure - creating a formula column to count number of linked duplicates

Hi all, 

Looking for any pointers here/help on how to create a formula using structure 7.3 that will count the number of linked Issues that are "is duplicated by". I'm working on a proxy metric to help with business prioritisation. 

After reviewing the help guide. I stumbled across the following example, that I hoped would provide a list of "duplicates" from which I could count. Unfortunately, this code does not present any response, nor does it display an error on those issues that have been marked as duplicate. Maybe it is working, just not providing an output as thought. 

WITH _format(issue) = """[${issue.key}|${issue.url}]""" : issuelinks .FILTER($.type = 'Duplicates' AND $.destination = this) .MAP(_format($.source))

Any help as to why above is not working, and suggestions to achieving the count of the duplicate issues would be much appreciated. 

 

 

1 answer

1 accepted

3 votes
Answer accepted

Hi there,

Phil here, with the Tempo team that created and support the Structure product. That's a really clever example formula you've found, though it may be so clever it's hard to decipher and work with if you aren't a seasoned Expr pro.

It seems that you're looking to create a formula column that just returns the amount of issues linked to each source issue for a given link type. We could write that as follows (and I'll break down what each step means after):

SIZE(issuelinks.filter($.type="duplicates").filter($.source=this))

What we're doing here is the following.

Let's look inside the SIZE function first, where we are going to grab an array of all the issuelinks for this issue. We are then going to filter this array twice since we don't want ALL the issuelinks, the first filter says "I want only the issuelinks that are of the 'duplicates' type". The second filter says "I only want the issues that originate in this issue", we should remember that all issue links have 2 issues involved, a source and a destination. This leaves us with an array of all the issuelinks that meet this criteria, so we then do a SIZE operation on this array, since we just want to know how many of these there are.

 

Let me know if that helps or if you have any followup questions.

Best,

Phil Heijkoop

Head of Product Solutions

Tempo

Thanks very much - super helpful. 

Like # people like this

this is pretty cool. I'm getting stuck in trying to apply in my structure. I have a structure with linked items, duplicates, implements, the works.
I'm thinking my fault is in declaring 'this'. I've declared it to be 'Key' , but I'm guessing it should be the object instead?

How should I declare it?

Suggest an answer

Log in or Sign up to answer