Forums

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

How to show issues in issuepicker field based on portal based on previous field

Marco Brundel
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.
November 17, 2020

I have a request type with a custom field (customfield_12401) (type Select field Single select) and then a scriptrunner issue picker field (customfield_14700).

Customfield_12401 is filled in the issues that can be selected at the issue picker field.

Now with a behavior based on the value entered on the request type at customfield_12401 in the issue picker field I only want to show the issue where that value is also filled in customfield_12401.

 

I already have part of a groovy script but I can't quite figure it out yet.


import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.project.ProjectManager

def customFieldManager = ComponentAccessor.getCustomFieldManager()
def projectManager = ComponentAccessor.getProjectManager()
def projects = projectManager.getProjectObjects()

def formField = getFieldById("customfield_12401")
def customField = customFieldManager.getCustomFieldObject("customfield_12401")

def prList = ComponentAccessor.getProjectManager().getProjectObjects()


getFieldByName("Standaard Change").setConfigParam("currentJql", "issuetype = 'Test Case Template' AND status = Active AND summary !~ Rollback AND cf[12401] = ${issueContext.Customfield_12401}")

 

How do I put the value of the value entered on the request type at customfield_12401 in the currentJQL?

Thanks in advance, Marco

1 answer

1 accepted

0 votes
Answer accepted
Marco Brundel
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.
November 19, 2020

It is working with a server side script on the field "Assignment group". :-) 

 

import com.atlassian.jira.component.ComponentAccessor

def customFieldManager = ComponentAccessor.getCustomFieldManager()
def assignmentGroup = getFieldById(getFieldChanged()).value

getFieldByName("Standaard Change").setConfigParam("currentJql", "issuetype = 'Test Case Template' AND status = Active AND summary !~ Rollback AND cf[12401] = \"" + assignmentGroup + "\"")

 

 Screenshot 2020-11-19 at 13.20.35.png

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events