Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Create subtask only if parent task has all the necessary fields updated

Shamanth
Contributor
February 10, 2023

Hi,

I want my users to create a subtask only if the parent task has all the necessary fields updated. You may ask me to make those fields mandatory, but the task is created by a project lead, where he only fills the basic fields while creating the task. Later when it is assigned to a team member, that person has to fill the rest of the details before creating the subtask.

How can I do this?

1 answer

1 vote
Alex Koxaras _Relational_
Community Champion
February 10, 2023

Hi @Shamanth 

One solution would be to place validations on the subtask's create transition in order to check these field on creation.

Another solution would be to use Behaviours from Scriptrunner to make a subtask's fields mandatory during creation.

Shamanth
Contributor
February 10, 2023

I tried exploring solution one, but I really could not figure out how to validate a parent while creating a subtask. Is it possible to explain more?

Alex Koxaras _Relational_
Community Champion
February 10, 2023

@Shamanth do you have an app like JMWE or JSU, or JWT?

Shamanth
Contributor
February 10, 2023

I am exploring JSU Automation Suite for the same reason. There I tried using the Linked Status Validator but quite can figure out if I am doing it right there.

Alex Koxaras _Relational_
Community Champion
February 10, 2023

Hmm.. JSU unfortunately doesn't offer this validator. I didn't recall correcltly. If you are open to explore functionalities from JMWE or JWT you can achieve what you ask by using:

  • Logical expression:  Evaluate a logical expression that returns true or false - a most universal and powerful function to compare field values across any kind of issue relation, count sub-tasks or links. (JWT)
  • Related Issues Validator: Validates that one or more issue links are being created during the transition, or that certain related issues exist (such as linked issues, Stories of an Epic, Epic of a Story, subtasks of an issue, issues returned by a Groovy script or a JQL search, etc.). (JMWE) OR
  • Scripted (Groovy) Validator: Custom validator based on a Groovy expression/script (JMWE)
Shamanth
Contributor
February 10, 2023

Okay, let me check them out and I will get back to you. Thanks for spending time on my question ;-) 

Vicente Domínguez _Decadis AG_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 13, 2023

Hello @Shamanth and thank you @Alex Koxaras _Relational_ for mentioning us!

Although the Logical validator is one of our most powerful validators, it might be easier to implement for this purpose the Fields required or changed validator. It will allow you to either make any field required for a particular transition or to prompt the user to change them during the transition itself in a transition screen with a very intuitive user interface.

You could also configure it so that the transition will be only executed if some of the fields are empty, which might be of help if you need to avoid that the Project Lead fills some of these fields accidentally.

We offer many more validators, such as Validation of linked issues, Validation of sub-tasks or Validation based on JQL query. If you need more information about them or about any other feature, please, visit our documentation or let us know via our Support Service Desk.

I am part of the Support Team for JWT.

Best regards,

Vicente

Shamanth
Contributor
February 14, 2023

Hi @Alex Koxaras _Relational_ ,

I have decided to use ScriptRunner plugin to enforce my usecase. Just to elaborate again, I want my users to create a subtask only when a custom field in the parent issue has the right value. Meaning that the field satisfies a given RegEx condition eg: NA|[0-9]{3}

Do you have a Groovy code for this? I can add this as a simple script validator at the workflow level.

Like Nic Brough -Adaptavist- likes this

Suggest an answer

Log in or Sign up to answer