Preamble
I am trying to add a requirement to add an 'Is Blocked By' issue link to a ticket when performing a certain transition.
I have SIL code that does this here:
if (size(linkedIssues(key, "Blocks", -1)) == 0) {
return false, "comment", "You must add an 'is blocked by' ticket link to denote which issue is blocking this work.";
};This basically says that if the amount of linked issues with the 'Blocks' type is zero, don't allow the transition and give an error message.
This works fine, but unfortunately it means that a user has to add the link through the 'More' menu, then make the transition. Or more commonly, try to transition, then go back through that.
For other similar issues, I have used the 'HasInput' method to figure out if a field in a transition screen has content. For example, the following will validate that either Assignee or a custom field is populated in order to make a transition:
if(hasInput("assignee")) {
return true;
};
if(hasInput("customfield_10900")) {
return true;
};
if(isNotNull(assignee)) {
return true;
}
if (isNotNull(customfield_10900)) {
return true;
};
return false, "comment", "Please provide a value in either the 'Assignee' or 'Group' field to queue this ticket.";Question
What do I need to do to make the 'hasInput' method work with the Linked Issues field. I have tried the following but with no luck:
if(hasInput("linkedIssues")) {
return true;
};Does anyone know what that string needs to be? And where I can see all the strings used for default Jira fields? Also, can I extend that 'hasInput' method to also check that the user has specified the 'Is Blocked By' link type, as well as a ticket to link to?