allLinkedIssues

Looking for the documentation on the newest versions of SIL Engine and the Simple Issue Language for Jira 8 for Server/Data Center? Click here !

Availability

  • This routine is available starting with SIL Engine™ 4.0.4.
  • This routine is available for Jira server and cloud deployment options.


Syntax

 allLinkedIssues(issueKey, [[linkTypeName], [direction]]);

Alias

getAllLinkedIssues (issueKey, [[linkTypeName], [direction]])

Description

Returns an array with the issue names linked with the specified issue, including the system links (subtask, issue in epic).

On the server version, the issues in epic are included. On the cloud version, only subtasks are supported.

This routine searches for all the linked issues with the issue given as argument (parameter) and builds an array that contains them.

This works for the already defined issue links as well as for the new defined ones. It can be used to find connections between different issues.

The third parameter [direction] is optional and it is used to specify whether to retrieve inward links or outward links.

To add new link types, follow the tutorial from https://confluence.atlassian.com/display/JIRA/Configuring+Issue+Linking.

Parameters

Parameter name

Type

Required

Description

issueKey

string

Yes

Specifies a string representing the key of the issue.

linkTypeNamestringNoSpecifies the link type.
directionnumberNo

-1, 0, 1 : Negative means inward links. Positive means outward links. Use zero to get both outward and inward links.

Parameters

Return type

string[]

The return value represents a list with all issues (issue keys) that are linked with the argument.

Example 

Following example represents the idea of this routine:

Let's consider the issue TEST-53 that is an epic and has the following links:

  1. Blocks TEST-54
  2. Is cloned by NANE-300
  3. Has two subtasks
  4. Is epic of three issues



If we run the following SIL code:

return allLinkedIssues("TEST-53");

The result will be an array with seven elements (four elements in cloud version)

Done. Program returned: TEST-59|TEST-60|NANE-300|TEST-51|TEST-52|TEST-54|TEST-55;


If we run the following SIL code (server version only):

return allLinkedIssues("TEST-53", "Epic-Story Link");

The result will be an array with three elements: 

Done. Program returned: TEST-51|TEST-52|TEST-55

The same result will be returned for the following script (server version only):

return allLinkedIssues("TEST-53", "Epic-Story Link", 1);

So we can specify the direction in order to get the epic link for a given issue or the links in a given epic:

return allLinkedIssues("TEST-51", "Epic-Story Link", -1);

In this case, the result will look like this:

The result will be an array with three elements: 

Done. Program returned: TEST-53

If we run the following SIL code (server version only):

return allLinkedIssues("TEST-53", "jira_subtask_link", 1);

The result will be an array with two elements: 

Done. Program returned: TEST-59|TEST-60

If we run the following SIL code in cloud version:

return allLinkedIssues("TEST-53", "Sub-task", -1);

and

return allLinkedIssues("TEST-53", "Parent", 1);


The result will be following: 

Returns all the links and the subtasks for that issue


If we run the following SIL code in cloud version:

return allLinkedIssues("TEST-53", "Sub-task", 1);

and

return allLinkedIssues("TEST-53", "Parent", -1);


The result will be following: 

Returns all the links and the parent for that issue


See also