Hi,
title says it all.
I have transition screen to force a person to fill in a linked issue. How can I set a validator to only allow the user to select a linked issue from a specific project?
Key: "BD"
Cheers,Jason
Create a simple scripted workflow validator on the same transition as the screen where the user is inputting the linked issues. This script will make sure all the users choices issues are part of the project with key "BD".
import com.atlassian.jira.component.ComponentAccessorimport webwork.action.ActionContextdef fieldManager = ComponentAccessor.fieldManagerdef issueManager = ComponentAccessor.issueManagerdef linksSystemField = fieldManager.getField("issuelinks")def request = ActionContext.requestdef params = request.parameterMapdef issueLinkingValue = linksSystemField.getRelevantParams(params)def linkedIssues = issueLinkingValue.linkedIssuesdef linkedIssueProjects = linkedIssues.collect { issueManager.getIssueObject(it).projectObject.key }linkedIssueProjects == ["BD"]
Thank you very much! It worked absolutely as expected.
It looks like you're new here. Sign in or register to get started.