Hi everyone,
I have many Jira projects whose names follow a specific pattern: each project name is composed of three parts separated by hyphens. The first part represents the Area, the second part is the Service Level 1, and the third part is the actual Jira project name. For example, a project might be named “Finance - Reporting - Project X”, where “Finance” is the Area, “Reporting” is the Service Level 1, and “Project X” is the Jira project.
I want to group my projects based on the Service Level 1 portion into a custom dimension called “Service N1”. In other words, I want any project name that has the second part as “Reporting” to be mapped to “Reporting”, and similarly for other Service Level 1 values. This will allow me to measure metrics like Lead Time by these groupings without having to create dozens of separate calculated members.
I have tried using JavaScript in Advanced Settings with code like:
function() { if (!issue.fields.project) return null; var projectName = issue.fields.project.name; if (projectName.startsWith(“Finance - Reporting -”)) return “Reporting”; if (projectName.startsWith(“Marketing - Digital -”)) return “Digital Marketing”; return null; }
I have set the field to “Import as dimension”, but the new dimension often shows only (none) in my reports, even though I am sure the project names match the pattern exactly.
My questions are:
- Is my JavaScript syntax correct for extracting the Service Level 1 part from the project name?
- Should I perform a full re-import or is an incremental import sufficient after making these changes?
- Are there any other reasons why the dimension might remain empty despite the project names following the “Area - Service Level 1 - Jira Project” pattern?
Any tips or best practices to avoid creating many calculated members would be greatly appreciated.
Thanks in advance for your help!
EaziBi Noob