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

Linked Issue Validator condition Edited


i have 2 issue types Type 1 and Type 2

i need to block the user from creating type 2 using create button, as from the ticket created as Type 1 i have a transition to create a ticket with  issue type = Type 2 and link it to Type 1 ticket.

I succeeded with blocking the users from creating issues of type1 but the transition of type 1 is not anymore working, 

under the workflow of Type 1 i add create linked issue of type 2

Create Issue
Summary: Off Boarding %original_summary%
Description: This is an off boarding ticket created automatically via the worflow
Project: Original project
Issue type: Off Boarding (10602)
Priority: Parent's priority
Reporter: Current user
Assignee: Parent issue's assignee
Affected versions: None
Fixed versions: None
Components: Parent issue's components
Link: %original_key%, Link type: Relates, Link direction: From new issue to issue key
Copy original issue custom fields: Employee,Job Title

under the workflow of Type 2 i added this code under validator of create transition

Issue issue = issue.getLinkedIssues()[0]
return true
else return false
else return false

thank you.

2 answers

1 accepted

0 votes
Answer accepted

I think you have a chicken and egg problem. You cant "get linked issues" of the type2 issue, because it doesn't exist yet when you are trying to create it. So your validator will always return false.

There are very few items that can be accessed in the create transition. If the requirement is "only allow this issue to be created if it is linked to another issue" i'm not sure you can do that.

What you may be able to do (and I havent tested this, so i cant prove it will work or not) is have a field that is not visible on the create screen, but can get set from the workflow, and check validation on that field. That way its like a "secret" flag that can only be set from automation, and the user can't set it in the create screen.

I'm not sure it will work though, the field may need to be on the screen for it to get set in the create.

You might want to look at making the "type2" issue a subtask. You might have more options with parent vs linked issues.

I converted the type2 to sub task, then I put the condition on level of sub task creation that should be inherent from a parent of type1 and it works.

Thank you. 

You can add a validator on the create transition that disallows one from creating an issue.   I would put in the error message.  "Do not create issue of Type 2, please use Type 1 for all new issues.  If you need to create a Type 2 issue, please use these steps..."

That's what I do and I succeeded with blocking the users from creating issues of type 2 but my problem here that am not able to create the ticket from the transition of type1

There is a plugin called "Create on Transition" that makes that operation easy,  Is that what you are using or are you trying to just use groovy?

well am just using groovy under validators section of create transition of Type2

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Jira

Keep your team in the loop with Team @mentions in Jira Software!

Hi everyone! My name is Jenny, a Product Manager at Atlassian. After launching Team @mentions in Confluence, we heard a lot of positive feedback from customers that they love how easy it is to @men...

226 views 4 12
Read article

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