Hi everybody,
i'm using groovyrunner validator Has at least one outward duplicate link in a workflow transition. In the workflow screen i have added the linked issues field so i can create a link during transition.
The problem i have is that, if before transition i do not have a duplicate link transtion is never executed.
Is there a problem in linked issue field type?
In validation of custom fields for example i can enter values in transition screen and values are validated.
Thanx in advance,
Kostas
The sample code for validators (as opposed to conditions) doesn't work, because unlike other issue metadata the issueLinkManager doesn't report any links until the issue is committed to the database.
IMHO this is a jira bug, and the current links should be available by calling a method on the issue.
If you look at previous questions about this @Henning has found a way to do this using the servlet request, although this won't work for programmatic transitions, or remote API calls.
Got it,
Thanx Jamie
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
AAC got the wrong Henning, it's this one: @henning-tietgens
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Seems not to work :-) The second link is the same, it's not me :-)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I know, I gave up after the second link ;-) It's some inferior low-karma Henning!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Based on some help from Henning, I use the following validator script to check for one, and only one, duplicate link during our "Close as Duplicate" step/transition. We use JIRA 4.4.
def issueLinkManager = ComponentManager.getInstance().getIssueLinkManager() // for version 5.0+ // import ComponentAccessor //def issueLinkManager = ComponentAccessor.getIssueLinkManager() def request = ActionContext.getRequest() if (request) { // check for new duplicates link linktype = request.getParameter('issuelinks-linktype') linkedIssue = request.getParameter('issuelinks-issues') reqLink = (linktype == 'duplicates' && linkedIssue) } // check for existing duplicates link oldLink = issueLinkManager.getOutwardLinks(issue.getId())*.issueLinkType.name.contains('Duplicate') // Transition requires one, and only one, duplicates link // XOR reqLink and oldLink if ( ! reqLink ^ oldLink ) invalidInputException = new InvalidInputException("Close as Duplicate requires One, and only One, link with type = 'duplicates'.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am having a similar issue. I want to add a validator to the Create transition to check if Linked Issues has at least one issue with the "tests" link type. I.e. I'm trying to make sure a Test issue type can't be created unless it has been linked to at least one User Story. I tried the code above with "tests" but it doesn't work.
Well, it works, but it always fails validation, even when I have added a link type "tests" and selected an issue.
We are using JIRA 6.0.8.
Thanks in advance!
Jeannette
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.