I have added Link Issues field to my Create and some of the Transition screens. I want to control on the Type of Issues which can be linked to a specific Issue Type. After couple of attempts I resorted to using SIL Validatiors in Create & Workflow Transitions. But I never get the list of issues which user is trying to Link when using linkedIssues API.
My guess here is, since the validators are called before the changes are saved, these API wont work when trying to fetch data which is at that instance transient. i.e. still pending to be written.
So if this wont work then, Is there something else which can be used in its place?
Hi Salman,
You are completely right about the transient values.
As it stands now, the only way I can think of that would solve your problem is to use a live fields configuration that would call lfExecuteJS() to run some javascript code (this is not going to be easy) that would prevent the user from selecting the wrong issue type in the transition screen.
HTH
However, you can just remove the wrong issues in a post-function placed at the end of the post-functions chain, but i'm not sure "disappearing" issue links is acceptable practice.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Disappearing links is a no go. The JavaScript one is something I will look into. But I cant really get around my head how will I get the issuetype of the selected issues there. Thinking...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
At this point I think your best option is to write your own addon that will provide the validator. It's easier than the javascript alternative.
Check out https://developer.atlassian.com/display/JIRADEV/Creating+Workflow+Extensions
It's complete with full example plugin source code and everything.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Wouldn't it be easier to simply train your users instead of trying to force this on them?
Why aren't they allowed to link to certain issue types?
Best regards,
Peter
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If it was that easy, there would have been no need for Validation & Condittions in Jira.
These restrictions are to enfore a workflow around specific type of issues based on the way things are done here. The end result is the reports as we need them :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am using Jira 6.1.2 and JJupin 2.6.8
if (issueType == "Feature Task") { string [] linkedIssues = linkedIssues(key, "Contributes", 1); string errorMessage; if (arraySize(linkedIssues) > 1) { errorMessage = "Feature task can be associated to only 1 New Feature item.";
} else if (arraySize(linkedIssues) == 1) { for (string likedIssue in linkedIssues) { if (%linkedIssue%.issueType != "New Feature") { errorMessage = "Only a new feature can be set as Contributes to."; } } } if (length(errorMessage) > 0) { return false, errorMessage; } }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Salman,
Can you please attach the SIL script that you are using as validator in Create & Workflow transitions? Plese let us know also what Jira and JJupin versions are you using.
Thanks,
Alex
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.
Register NowOnline forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.