How do I, using JMWE connector, restrict "Linked Issues Status Validator" rule

Deleted user January 2, 2020

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.

2 answers

1 accepted

0 votes
Answer accepted
David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 3, 2020

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.

Deleted user January 3, 2020

Thanks David.

Lily Wang August 5, 2021

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 ?

David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 5, 2021

Hi @Lily Wang 

this is what you need:

! (["Status 1","Status 2"].includes(linkedIssue.status.name))
Lily Wang August 5, 2021

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.

David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 5, 2021

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)?

Lily Wang August 5, 2021

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.

David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 5, 2021

@Lily Wang 

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.

Like Lily Wang likes this
Lily Wang August 5, 2021

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.Image20210806112924.png

0 votes
David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 2, 2020

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)?

Deleted user January 3, 2020

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".

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events