Hi Community,
For an audit control, we need to create a report that returns all the User Stories that within a customfield contain https://confluence.ar.bpph as part of their text and we cannot find how to solve it.
Thank you very much for the help
Hi @adgonzalez,
There are two options for how to get the User Stories with a specific value pattern in the custom field.
Option 1: calculated measure
Yuo can create a new calculated measure that would iterate through individual issues and check their value for a specific custom field. The expression might look like this:
NonZero(Count(
Filter(
--iterate through all issues
DescendantsSet([Issue].CurrentMember,[Issue].[Issue]),
--for each check the custom field value
[Measures].[Issue Requirement notes] MATCHES "[\s\S]*https://confluence.ar.bpph.*" AND
--check if issue matches report context - page filters
[Measures].[Issues created] > 0
)
))
More details on calcauted measures and used functions Descendants, Filter are described in the documension:
Note that this is a resourceful calculation as it should check on all imported issues that might impact report performance.
Option 2: JavaScript calcauted field during data import
You can import a new measure that would show the count of issues with specific values in a custom field. The logic is similar to the calcauted measure, but it is done during data import and would not affect the report performance. Please see the documentation for more details: Account specific calculated fields.
The calculated field for your use case might look like in the picture below:
Here is the JavaScript part used in the example: replace the NNNNN with the custom field ID you have in your Jira and eazyBI.
//first check if issue has a custom field
if (issue.fields.customfield_NNNNN) {
//use a backslash before special characters like . and /
const pattern = /https:\/\/confluence\.ar\.bpph/;
const found = pattern.test(issue.fields.customfield_NNNNN);
//return 1 if matches pattern else return nothing
return found ? 1 : null
}
Import the new calcauted field as measures and use it in the report to see how many issues have link “https://confluence.ar.bpph” in the customer field.
Best,
Zane / support@eazyBI.com