So I have a checklist in sub task, I want to automate when task status done update severity of parent:
1. Make sure at least one item is checked.
2. For each severity section, count how many boxes are checked.
3. Determine Overall Severity:
Pick the level with the highest number of checked items.
If two (or more) levels tie, choose the higher severity level (e.g. number of checked item in Minor = number of checked items in Major then choose Major)
4. Store Results:
Save the chosen severity (e.g. “Severity 2 / Major”) into a variable (e.g. {{overallSeverity}}
).
Save the count of checked items for that level into another variable (e.g. {{severityCount}}
).
5. Update parent
Hi @Manjinder Kumar -- Welcome to the Atlassian Community!
What have you tried to solve this need?
If you have a rule that is not working as expected, context is important for the community to help. Please post the following:
Until we see those...
Have you tried splitting the field on the severity values into a list, counting the elements in each, and storing the results in variables for comparisons?
Kind regards,
Bill
Apologies, @Bill Sheboy
I am company managed cloud jira.
So I am using smart checklist - Severity 1, 2, 3, 4
I am trying to get which severity category has maximum checked items using this:
{{#math}} MAX( issue.checklists["Severity 1 / Critical"].items.filter(i -> i.checked).size, issue.checklists["Severity 2 / Major"].items.filter(i -> i.checked).size, issue.checklists["Severity 3 / Moderate"].items.filter(i -> i.checked).size, issue.checklists["Severity 4 / Minor"].items.filter(i -> i.checked).size ) {{/math}}
then comparing maxCount with each severity level like this:
{{issue.checklists["Severity 1 / Critical"].items.filter(i -> i.checked).size}} equals to {{maxCount}}, If yes I want severity category and checked items in list.
but it seem I am its not woking.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
First, lists do not use an array syntax such as you show with:
issue.checklists["Severity 1 / Critical"]
They have a get() function, but that will not help unless the checklists field is a list and you know the number index to access:
Next, there is no "filter" function for list smart values. These are the supported functions for lists:
https://confluence.atlassian.com/automation/jira-smart-values-lists-993924868.html
You can instead use conditional logic over a list's fields to filter it:
https://confluence.atlassian.com/automation/jira-smart-values-conditional-logic-1081351607.html
Please try that to filter by one of the values, then try wrapping the result in a math expression to count the number of selected options in the checklist.
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.