can i use jjupin to validate if a link exists

I want to be able to validate if a link exists on an issue as a condition of workflow

3 answers

1 accepted

0 votes
Accepted answer

Oh, I see now.

Yes, it is possible using JQL like this (this is the SIL code that when used in a condition will do just what you want):

string [] linkedIssues = selectIssues("issue in linkedIssues(\" " + key + " \") ");
if(size(linkedIssues) == 0){
    return false;
}
return true;

Additionally, we have a specialized routine in our roadmap that will do: getLinkedIssues(parent, issueLinkType)

Thanks.. I will try this out shortly and let you know if I have any issues/questions.

Florin

I've tried this and it always returns false. What might I be doing wrong?

My bad! I accidentally added an empty space before and after the key which resulted in the JQL being "issue in linkedIssues("<space><KEY><space>")".

The correct form is

selectIssues("issue in linkedIssues(\"" + key + "\") ");

.. note the removed spaces

Sorry about that.

Hi Jim,

It's not really clear to me what you are trying to accomplish here. You want to see if a condition in the workflow is fulfilled (which would mean that there is a specific transition available as a button on the issue) ? Where would you like to do this check? In a post-function? Listener? Service? Gadget? Please give us more details about the problem you are trying to solve.

Regards,

Florin Manaila.

Thanks Florin

In a pre-condition (or validation) I want to NOT allow users to see/use the transition button if there is ZERO linked issues. I cannot use subtasks because this pre-condiation may be applied to subtasks as well. Hopefully that helps.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 29, 2018 in Marketplace Apps

How to set up an incident workflow from the VP of Engineering at Sentry

Hey Atlassian community, I help lead engineering at Sentry, an open-source error-tracking and monitoring tool that integrates with Jira. We started using Jira Software Cloud internally last year, a...

1,326 views 0 8
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you