Forums

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

How can I get linked issues from a transition screen with SIL?

Matt Albone
Contributor
August 17, 2020

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?

3 answers

0 votes
gustavo_refosco
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 Champions.
December 12, 2014

Hi Shelli, Yes, but I'm sorry for missing the 4th question in that topic didn't make sense as we still didn't confirm if you are using a proxy. I'd like you to provide the answers to: 1) Are the base urls correctly set in both the instances? 2) Are they reachable from the each of their servers via the configured base url? 3) Are you using the same url while entering the link for the application? 4) Can you please confirm if there are any proxies or SSL in place in front of FishEye or JIRA, and let us know how they are configured? Regards, Gustavo Refosco

0 votes
Shelli
Contributor
December 12, 2014

I don't understand your comment. You want me to post answers from another question here?

0 votes
gustavo_refosco
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 Champions.
December 12, 2014

Hi Shelli, I've found another topic with another user getting a similar error as you are, please see it at https://answers.atlassian.com/questions/230871/error-when-linking-jira-and-confluence . Could you please provide here the answers to the same questions Renjith made in this topic? This will help better understanding your scenario. Regards, Gustavo Refosco

Suggest an answer

Log in or Sign up to answer