Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Links

Let's say you want to link the current issue to another issue that you select. Using Power Custom Fields™ you can do this easily. 

Considering

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 Select configured with one Autocomplete configured in the following ways:

, one
  • script file

, minimum
  • Minimum characters for autocomplete set to 5

and the maximum
  • 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 RemovedFor this example we image-20240214-170117.pngImage Added

We used the following SIL data source:

Code Block
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:

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

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

Note that you
Note

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").

In order to

To do this,

you can use 

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

See More

Child pages (Children Display)
pageExamples for PCF