Hi everyone,
I am currently having issues when trying to create an "either, or" validator within a Jira workflow.
The setting is as follows: When working on a task, users can report their time spent on sub tasks, which will then be added up within the parent task. This is not a must, as sub-tasks are optional. When doing the final transition, I would like to ensure that times have been reported. Due to the nature of things this can either have happend via the accumulated sub-task times or via a time spent log during the transition itself.
We have tried solving this by using Jira Expression Validators, enabled through the app "Workflow Building Blocks for Jira" (https://marketplace.atlassian.com/apps/1233642?tab=overview&hosting=cloud). The expression we have tried is:
(issue.worklogs != null ) || (issue.timeSpent != null)
Using the normal field value validator is also not working, as checking for both "Time spent" and "∑ Time spent" creates an AND condition.
Maybe someone encountered this issue before and knows a workaround or fix for my Jira expression.
Hi @Jannis Ruef
Thank you for your interest in the app and your question. Please correct me if I’ve understood your requirement correctly: if you want to simply ensure that time is logged either on the issue itself or on any of its subtasks, the following might suffice for you:
issue.timeSpent != null || issue.subtasks.some(subtask => subtask.timeSpent != null)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That’s great! I’m happy to help. :)
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.