JQL Functions

STAGIL Assets introduces new JQL functions that can be used in the advanced issue search and STAGIL custom fields.

issue in relation("","",...,"")

The add-on provides a new JQL function to find all your issues within certain relations. It gives you a list of all related issues, searching from a start node over the given relations. You can also use the parameter “all” in order to search through the entire link network (It may impact your search performance).

issue in relation("", "",...,"", "")
issue in relation("start", "relation_1",...,"relation_n", "level")
issue in relation("","...", "all")

Following parameters are used:

Start - This is the node to start your search from. You can use regular JQL syntax to define your node or nodes. The Start node is always in the result list of your search.

Relation_x - Provide 1 to n names of relations you would like to search for in the asset network. 

Please use the exact names from your relation table. Do not use the inward or outward names.

Level - Provide the depth of your relation as "level1", "level2", "level3" or "level4". Maximal depth is 4.

issue not in relation("","",...,"")

This JQL function works exactly as “issue in relation” but will give you the negation of it: all issues that are NOT in relation that you have defined.

JQL Examples

issue in relation("key = CRM-18", "Organization-Contact", "level1")
issue in relation("key = CRM-18", "Organization-Contact", "level2")

You only use the relation "Organization-Contact", but go two levels. First from Contact (CRM-18) to Organization (find CRM-10) and then to other Contacts connected (find CRM-19).

type = Contact AND issue in relation("key = CRM-18", "Organization-Contact", "level2")

You can also use the standard link type of JIRA.

issue in relation("key = EPIC-1","Epic-Story Link","jira_subtask_link" ,"level2")

This search shows where EPIC-1 is a key of some Epic.

JQL Variables

Usage only in STAGIL Assets Dynamic Dependend and  STAGIL Assets Lookup fields. 

The following variables pull data from the issue where the Assets field is located in.

Use apostrophes in case the data to pull contain spaces in between. Example: '{source.customfield_id}'

{sourcekey}

Provides the key of the issue, where the assets field is located in.

{projectkey}

Provides the key of the project of the issue, where the asset field is located in.

{reporter}

Provides the reporter (as user) of the issue, where the assets field is located in.

{currentusermail}

Provides the mail address of the current User who is logged in.

{mail.reporter}

Provides the mail address of the reporter.

{mail.assignee}

Provides the mail address of the assignee.

{mail.customfield_12345}

Provides the mail address of a single user picker custom field.

{source.customfield_id}

Provides data pulled from a selected customfield, based on the current source issue. 

{source.summary}

Provides the summary of the current issue.

currentUser()

Provides the name of the user who is currently logged in. 

searchingUser()

Provides the name of the user who is running the search (can be defined in the configuration menu of asset customfield).

JQL Variable examples

This JQL in a Lookup field in an assets issue finds all issues, where fixVersion is the same as in {source.customfield_16404}

fixVersions in ({source.customfield_16404}) 

This JQL in a Lookup field in an assets issue finds all service requests that are related to the current issue.

 type = "Service Request" AND "Affected CI" = {sourcekey}

This JQL in a Lookup field looks up all service requests from the same reporter.

 type = "Service Request" AND reporter = {reporter}

This JQL in a relation custom field provides only assets which "belong" to the current user.

 type in (Smartphone, Notebook, Printer) AND assignee = {currentusermail}