Example 2 - Issue Links

Issue links

For this example, you need to link an issue with another issue you select using Power Custom Fields. 

In this example, we have a PCF - Single Autocomplete configured in the following ways:

  • One SIL Data Source script file

  • Minimum characters for autocomplete set to 5

  • Maximum results number set to 50.

We want to select an issue using its key or summary. You can see the custom field in the picture below: 

image-20240214-170117.png

We used the following SIL data source:

string [] issues = selectIssues("created < now()"); string [] res; for (string iss in issues) { if (contains(iss.summary, argv["query"])) { res = addElementIfNotExist(res, iss); } } return res;

The select script used is:

KPOption[] selectedOption = customfield_12209; linkIssue(key, selectedOption[0].value, "Relates");

This creates a "Relates" type link between the current issue and the selected issue.

You'll have to use the name of the link issue, as you find it on the Issue linking page (in our case, "Relates" and not "relates to").

To do this, use the argv["query"] only if you set the Filtering Strategy (from Autocomplete settings) to Datasource.

See More