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.
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
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, I seem to have the same issue but I suspect it is because I am using the cloud version of Structure, and "this" is not supported according to this page. How would we work around it ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Marijn Plat @Pierre Walhin
There is indeed no this function in Structure Cloud yet; using key instead in the same formula can work too.
I hope this helps. If you need help with the formula or anything else, please reach out to us directly at our support portal.
Best regards,
Stepan
Tempo (the Structure app vendor)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The answer is very useful to me, as I have similar issues. The explanation you gave under "What we're doing here is the following." is exactly what I needed !
Thanks a ton @[deleted] khodolov
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.