Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

Edited

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

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.

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 ?

Hi @Lily Wang 

this is what you need:

! (["Status 1","Status 2"].includes(linkedIssue.status.name))

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.

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

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.

@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

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

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

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

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you