Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Make the system field link issue required

karim.belhadj
Contributor
March 19, 2020

Hello team

 

I have a business requirements , we need to oblige customer when he create issue to link this issue to a story , so the linked ticket or issue must be mandatory .

I do not found how to do it .

 

I need your help 

 

Regards 

 

2 answers

0 votes
David Fischer
Community Champion
March 19, 2020

You can use JMWE's Related Issue(s) Validator, the options to pick will be pretty straightforward.

Aditya Sastry
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 19, 2020

@David Fischer  can you help me understand how to use this Validator?

If you have any example to share that will help. Also I was not able to find this Validator in my instance so confused.

David Fischer
Community Champion
March 19, 2020

Which version of JMWE for Jira Server do you have?

Aditya Sastry
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 19, 2020

Installed version:6.1.2

Radhika Vijji _Innovalog_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 19, 2020

Hi Aditya,

You need JMWE 6.2.0 or above to find the validator. Please upgrade from the Manage add-ons page. 

Regards,

Radhika

Aditya Sastry
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 19, 2020

Thanks @Radhika Vijji _Innovalog_ I just upgraded my plugin. Will check this now.

karim.belhadj
Contributor
March 20, 2020

@Aditya Sastry @Radhika Vijji _Innovalog_ @David Fischer 

Nice to meet you , thank you for your support .

 

Regards

Karim

Aditya Sastry
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 20, 2020

@karim.belhadj Nice to meet you too. If the solutions solve your issue kindly accept the answer.

Thanks! have a nice weekend!

Aditya Sastry
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 20, 2020

JMWE's Related Issue(s) Validator suggested by @David Fischer works like a charm.

Thanks!

0 votes
Aditya Sastry
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 19, 2020

Custom Solution - Make a workflow transition button  for example - "Link to Story". Add a screen in the transition to show up a query custom field or issue picker field. Write your jql to allow only stories and make the field mandatory with validators. Write a post function to link the story to issue.

If this needs to be on Create, make the custom story field mandatory, write a post function to link the story to issue. 

Aditya Sastry
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 19, 2020

You can use the below code in script runner validator 

'Linked Issue(s) Validator (JMWE add-on)'

 

import com.atlassian.jira.ComponentManager;
import com.atlassian.jira.issue.IssueManager;
import com.atlassian.jira.issue.MutableIssue;
import com.atlassian.jira.component.ComponentAccessor;

String paramRequiredLinkType = "relates to";
List paramRequiredIssueTypes = Arrays.asList("Bug", "New Feature");

def request = webwork.action.ActionContext.getRequest();
if (request) {
String linkType = request.getParameter('issuelinks-linktype');
String[] linkedIssues = request.getParameterValues('issuelinks-issues');
if (linkType != null && linkType.equals(paramRequiredLinkType) && linkedIssues != null) {
if (linkedIssues.size() == 0) {
def myIssueManager = ComponentAccessor.getIssueManager();
for (String tmpLinkedIssue: linkedIssues) {
MutableIssue toBeLinkedIssue = myIssueManager.getIssueObject(tmpLinkedIssue);
if (toBeLinkedIssue != null) {
if (!paramRequiredIssueTypes.contains(toBeLinkedIssue.getIssueType().getName())) {
return false;
}
} else {
return false;
}
}
return true;
}
}
}
return false;

karim.belhadj
Contributor
March 20, 2020

@Aditya Sastry  thank you very much.

Suggest an answer

Log in or Sign up to answer