简体   繁体   中英

JIRA JQL select issues where issuekey contains key

I can select JIRA issues using this JQL query:

issuekey >= PRJ-23

results:

PRJ-23
PRJ-24
...
PRJ-2345
...

How can I select JIRA issues using "contains-like" operator? Smth. like:

issuekey contains "PRJ-23"

results:

PRJ-23
PRJ-230
PRJ-231
...
PRJ-2345
...

Thanks.

I am unaware of any way to do this with straight JQL, but there are other ways to get what you need:

1) If you want to run this on an external service, you can access the REST API for the Issue Picker.

You can see one example of how it works in Atlassian's REST API browser for jira.atlassian.com.

The query field contains the substring match that you want to find (eg. "CONF-301"). The currentJQL field also contains the JQL that describes the set of issues in which you want to find substring matches (eg. "project=CONF"). You can also fire up your web browser's debugger, go to view any issue in JIRA, click More->Link, type your substring into the search box, and look in your debugger's Network tab to see what requests it is making to the REST API above. Note that this interface is not documented (ie. it's not a public API and is subject to change without warning in future versions of JIRA).

2) If you are building a JIRA plugin instead, then the Issue Picker Search Service is listed as a public API, which you should be able to have injected into your plugin. This is the same service that is used by the above REST API.

you will have to retrieve the issue with this exact key and the issues that having their key greater than or equal to the searched key multiplied by 10

something like this validateQuery=false&jql=key="KEY"%20or%20key>="KEY0"%20ORDER%20BY%20key

this way if your key is "PRJ-23" it will retrieve the issue with key "PRJ-23" and the ones with key larger than or equal "PRJ-230" which will fulfill your requirement of retrieving "PRJ-23, PRJ-230, PRJ-231, etc..."

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM