I’m trying to automate the prioritization of issues based on their WSJF (Weighted Shortest Job First) score using Jira Automation. Specifically, I want to:
1. Fetch all relevant issues using a Lookup Issues action that retrieves issues with a WSJF score, sorted in descending order.
2. Assign a sequential priority or rank (1, 2, 3, etc.) to these issues based on their WSJF score, with Priority 1 going to the issue with the highest WSJF score.
The goal is to dynamically number each issue based on its position in the lookup result, assigning a unique number to each issue. I tried different methods but have yet to achieve this.
What I’ve Tried:
1. Using Smart Value {{index}}: I tried using {{index.plus(1)}} within a Branch rule to reference the position of each issue in the lookup results, but this clears the field instead of assigning a sequential number.
2. Creating a Custom Variable (priorityCounter): I created a variable to act as a counter that increments for each issue within the Branch Rule / Related Issues loop, using {{priorityCounter}}. This didn’t work as expected, as it didn’t apply unique numbers to the issues.
Desired Outcome:
- Fetch issues via JQL (e.g., all issues with a WSJF score).
- Sort them by WSJF score in descending order.
- Loop through the issues and assign Priority 1, 2, 3, etc. based on their WSJF score.
- Ensure each issue gets a unique sequential number based on its WSJF rank.
Q: Is there a way to assign unique sequential numbers to issues based on their order in the lookup result using Jira Automation? Any insights into why the {{index}} smart value or the counter method is not working as expected would be greatly appreciated.