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
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.
Hi @Jannis
Hope you're doing well! I just wanted to share that our quest to simplify the use of Jira Expressions has led to what we call the Ultimate Validator, now in Beta. With it, you can build complex conditions easily using a simple UI.
Below, you'll find how it works:
I hope you’ll like it!
Cheers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.