Hi I'm trying to write a "Linked Issues Status Validator" validation rule that only runs against a sub-task if a custom field on the sub-task is set to a specific value. Otherwise don't run the validation.
Is this possible with a linked issue validation rule?
Kieran.
Unfortunately, you can't do that with the Linked Issue Status Validator. You'll need to use the Linked Issues Validator instead, and test both the linkedIssue status and custom field in the Jira expression. Something like:
linkedIssue.customfield_12345.value != "An option value" || ["Status 1","Status 2"].includes(linkedIssue.status.name)
where customfield_12345 is the field ID of the custom field (assuming it's a single-select type field - otherwise, use the "Issue Fields" help tab to find out how to test your specific custom field) and "Status 1", "Status 2" the two statuses you want the sub-tasks to be in.
Thanks David.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
How can I express that the status of linked issue are excluded ?
linkedIssue.IssueLinkType.name != 'duplicated' ||linkedIssue.IssueLinkType.name != 'Confirm duplicate'
It does not work. How to make it work ?
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.
Unfortunately, it does not work.
Look at this phrase, this is what I want to express:
At least one issue link of the duplicates link type must be added to the transition screen , and at least one linked issue must satisfy the following Jira expression:
I need to use the following expression, right ?
!(["duplicated","confirmed duplicate"].includes(linkedIssue.status.name))
The following message will be displayed if validation fails: You need to link an issue which status is not "duplicated"
But it does not work. I can still link an only issue which is duplicated.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Lily Wang ,
I don't see how "At least one issue link of the duplicates link type must be added to the transition screen , and at least one linked issue must satisfy the following Jira expression:" matches with the validation error message ("You need to link an issue which status is not "duplicated").
Based on the error message, I would assume you want to force the user to add an issue link on the transition screen, and the linked issue should not be in the "duplicated" status. Or do you simply want to prevent users from linking to an issue that is in the "duplicate" status (but not force them to add a linked issue)?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you very much , David.
I want to prevent user to transit if his linked issue type is only "duplicated" or "confirmed duplicate." When he linked issues, if there is one issue that is not duplicated, he can transit. But if all issues are "duplicated", he can not transit.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
it feels like your configuration should work for that. But please be aware that Status names are case-sensitive so you must write them exactly as they appear on the "Statuses" admin page.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, David,
It works now. The problem is I have two duplicates in system, that's why it does not work. When I change the upper one to the lower one, it works now.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kieran,
Is the sub-task the issue being transitioned, or are you trying to validate sub-tasks of the issue being transitioned (using the “is Parent of” link type in the validation configuration)?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi David,
Yes I'm trying to validate a sub-task of the issue being transitioned and i'm using the link type "is Parent of".
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.