Help with Structure formula

760 views
Skip to first unread message

Mike...@hotmail.co.uk

unread,
Aug 9, 2017, 6:50:48 PM8/9/17
to Structure Plugin for JIRA
Hi, 

I am trying effectively trying to do some defect reporting through structure. An example is Defect removal efficiency i.e. 

(Total bug - customer raised bugs) / total bugs * 100

We have a field call "external reference" which denotes if it is a customer found issue. to search for these in JQL i would do the following:-

Total bugs = "Project = x and issuetype in (bug, "story defect")"
customer raised bugs = "project = x  and issuetype in (bug) and "external reference" is not EMPTY". 

How would I do this in Structure formulas so it can automatically update rather than having to run the JQL and put it in a spreadsheet? 

Thank you, 
Mike

Igor Sereda

unread,
Aug 9, 2017, 7:04:15 PM8/9/17
to structure-pl...@googlegroups.com, mike...@hotmail.co.uk
Hi Mike,

Thanks for your question! You can definitely do that with Structure’s formulas.

This formula will be a little tricky because you divide aggregate values. But! I’d like to tell you first that with the upcoming Structure 4.2, it’s going to be much easier. However, for this example I would assume that you’re working on Structure 4.0 or 4.1.

First of all, you need to define a structure. For example, it could be a folder, under which a JQL inserter is placed for all issues you are interested in. I’m going to assume you know how to build a manual or automated structure — if you need help with that, let me know. 

Then we’re going to define our formula. Here’s the brief instruction.

1. Add Formula column and write a formula, say: (total_bugs - customer_bugs) / total_bugs. (You don’t need to multiply by 100 — there’s “Percent” formatting option instead.)
2. You can see that these names will appear as red — you need to define what those variables are. For that you will need to add two more formula columns.
3. One column will have this formula: IF(project = "Project Name" AND (type = "Bug" OR type = "Story Defect"); 1) — this formula would produce “1” if it’s a bug that you are interested in, and “undefined” otherwise. Then, in the column settings, you need to select that you’d like to SUM this value. So for the top folder you’ll get the value of total_bugs.
4. Similarly, the other column would have a SUM of formula: IF(project = "Project Name" AND (type = "Bug" OR type = "Story Defect") AND external_reference; 1) — note that I didn’t compare external_reference with anything, it should work if there’s a value in the field. If you see one of those variables to be missing (red), click on it to pick the custom field.
5. Finally, in the overall formula, you need to define total_bugs and customer_bugs by selecting formulas from “Used in Columns” attributes.
6. Then you can remove the extra two columns.


Structure 4.2 will let you achieve the same result without two additional columns. 

Hope this helps!

Kind regards,
Igor
--
You received this message because you are subscribed to the Google Groups "Structure Plugin for JIRA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to structure-plugin-f...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages