Forums

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

How do I ensure task is linked as contained in to specific issue types on creation?

Tracey Ryan May 13, 2020

Hi

I"m trying to update workflow validator, previously set up and working to ensure any new task creation is created with a 'linked issue' as 'contained in' a 'feature' issue type. 

The validator that works is:

At least 1 linked issues must be added on the transition screen with the is contained in link type and they must all respect the following condition:1

linkedIssue.getAsString("issuetype") in ["Feature"]


The following message will be displayed if validation fails: Task Must be Linked to a Feature.This validation only applies if the following condition is true:1

issue.get("issuetype").getName() == "Task"

 

I want to update the above to include our 'Discovery' issue type in the condition, so the task must be linked to either feature or Discovery issue type as 'contained in. 

However, when updating condition to be 

linkedIssue.getAsString("issuetype") in ["Feature", "Discovery"], the validator doesn't work for the discovery linking, and only works for FEature linking. Is there another way to write it so it can be either ?

thanks

1 answer

1 accepted

0 votes
Answer accepted
Radhika Vijji _Innovalog_
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.
May 13, 2020

Hi Ryan,

I do not see any issue in the script. It should work as long as the issue type name is "Discovery". Please recheck the issue type. Pay attention to the case, trailing and leading spaces. To test if the issue type has trailing/leading spaces, test this script against an issue with issue type "Discovery"

"/" + issue.getAsString("issuetype")+ "/"

 Regards,

Radhika

Tracey Ryan May 13, 2020

thanks Radhika - your script showed my discovery issue type had a trailing space. I've updated the script i had, and it now works. Thanks so much for your help

Suggest an answer

Log in or Sign up to answer