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

Is it possible to make linked issue required when create special issue type?

Is it possible to make linked issue required when create issue type = test? you should link it to any story or to any other issue type. And you could choose only one special type of link (tests, tested by)?

3 answers

1 accepted

0 votes
Answer accepted

Using JMWE, you can add a Related Issues Validator on the Create transition with the following options:

  • Mode: "Require the creation of issue links on the transition screen"
  • Issue Link: the link type to require
  • Valditator Scope: check the Conditional Validation checkbox and use a script to apply the validator only to Test issues:
issue.get("issuetype").name == "Test"

Thank you! Its perfectly works!!

@David Fischer _Appfire_ Hello =)
could you help me please write in Groovy 
Estimate Development != "0" and != "EMPTY"
I use it in Field Required Validator in work flow, when transit the issue) 

and may be any docs where I can learn and practice it )

issue.get("customfield_10803") is not null or empty 
this is not working

Assuming customfield_10803 is the Estimate Development field, you can do this:

!!issue.get("customfield_10803")

@David Fischer _Appfire_  but how it should be condition value of this field shouldn't`t be empty or shouldn't`t be "0"?

If customfield_10803 is a Number custom field, what I provided will work (zero is considered as "falsy"). If customfield_10803 is a Text field, then you need:

!!issue.get("customfield_10803") && issue.getAsString("customfield_10803") != "0"
0 votes

You forgot to mention which app you're using, and whether you're on Server or Cloud. 

If you have scriptrunner, you can use behaviours

In the initializers you can put something like this:

import com.atlassian.jira.issue.link.IssueLinkTypeManager
import com.atlassian.jira.component.ComponentAccessor

if (getActionName().equals("Create")){
def linkType = getFieldById("issuelinks-linktype")
linkType.setFormValue("blocks")
def entry = ComponentAccessor.getComponent(IssueLinkTypeManager).getIssueLinkTypesByName("B locks").collectEntries {it -> [it.outward,it.outward]}
def entry2 = ComponentAccessor.getComponent(IssueLinkTypeManager).getIssueLinkTypesByName("B locks").collectEntries {it -> [it.inward,it.inward]}
entry.putAll(entry2)
linkType.setFieldOptions(entry)
}


Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Apps & Integrations

Marketplace Partner Spotlight: Fine Software

Happy New Year, everybody! What better way to kick off 2022 than with a new Marketplace Partner Spotlight ✨ This month, we're getting to know Daniel Franz, co-founder of Fine Software. Fine Software ...

372 views 2 15
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