jql function haslinks not found
时间: 2023-07-16 14:13:58 浏览: 109
jira JQL cheatSheet
The "haslinks" function is not a built-in function in JQL (Jira Query Language). However, you can create a custom JQL function using the ScriptRunner add-on for Jira.
Here's an example of how to create a custom JQL function called "haslinks" using ScriptRunner:
1. Install ScriptRunner add-on for Jira if you haven't already.
2. Navigate to ScriptRunner > Script Fragments in Jira.
3. Click on "Add" to create a new script fragment.
4. Select "JQL Function" as the fragment type.
5. Enter "haslinks" as the name for the function.
6. Enter the following script in the "Code" section:
```
import com.atlassian.jira.component.ComponentAccessor
def issueManager = ComponentAccessor.getIssueManager()
def issuesWithLinks = issueManager.getIssueObjects(issue.id).any { issueLinkType ->
issueLinkType.getOutwardLinks().size() > 0 || issueLinkType.getInwardLinks().size() > 0
}
return issuesWithLinks
```
7. Save the script fragment.
8. Run a JQL query using the "haslinks" function. For example:
```
project = MYPROJECT AND haslinks()
```
This will return all issues in the "MYPROJECT" project that have links.
阅读全文