Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Can someone help me with JQL that uses a IQL function?

Travis Alexander [Empyra] January 20, 2022

 

I have an Insight object type called 'Software'

I have objects A, B, and C as in the 'Software' object type

I have a custom field called 'Affected Software', populated with insight objects A, B, and C.

 

I need JQL that returns me a list of all issues where 'Affected Software' has options A and B selected.

2 answers

1 accepted

2 votes
Answer accepted
Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 20, 2022

Hi @Travis Alexander _Empyra_

You'll want to incorporate iquFunction into your query.  Here's an article that describes it.

https://support.atlassian.com/jira-service-management-cloud/docs/insight-jql-functions/

Travis Alexander [Empyra] January 21, 2022

Thanks, Mark. I've actually see this - I just can't it to work.

Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 21, 2022

Hi @Travis Alexander _Empyra_ 

For clarity, not sure if you're looking for either A or B if both must be selected.  Here's a sample of how each would work:

Either A or B exists

customField in iqlFunction ("attribute IN (A, B)")

Both A AND B exists

customField in iqlFunction ("attribute = A") AND customField in iqlFunction ("attribute = B")

Hopefully this helps.

Björn Gullander
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 26, 2022

Did you get it to work @Travis Alexander _Empyra_ ?

iqlFunction is a bit messy, sometimes it easy to get into problems with double quotes in the IQL query. To make it easier you can enclose the IQL query with single quotes instead of double quotes like this:

"Affected Software" in iqlFunction(' Name IN ("software A", "software B")')

would be the same as 

"Affected Software" in iqlFunction(" Name IN (\"software A\", \"software B\")")

 Björn

Travis Alexander [Empyra] January 27, 2022

Here's what I'm getting..  (I can confirm the attribute is NAME and the object names are correct)

IQL.png

Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 27, 2022

Hi @Travis Alexander _Empyra_ - Have you tried using a double quote instead of a single?

 

"Affected Software" IN iqlFunction ("Name IN ("CDT","LOTO")")

Travis Alexander [Empyra] January 27, 2022

Ha! Didn't like that either.  

 

Error in the JQL Query: Expecting ')' or ',' but got 'CDT'. (line 1, character 48)

Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 27, 2022

I think your original query was actually correct with the single ticks.  However, IQL may be case sensitive.  Try using Name instead of NAME

Travis Alexander [Empyra] January 27, 2022

Wow. Surprisingly it just didn't like the capital "s" in Software. Apparently that part is case sensitive, not the "NAME" part.  Thanks so much for you help with this.

Like Mark Segall likes this
Björn Gullander
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 28, 2022

Yes attribute names are always case sensitive in IQL queries. Values are normally not case sensitive if you use common equal sign (=). Using double equal signs makes values also evaluate as case sensitive. 

Name = "john" (will find both "John" and "john")

vs.

Name == "john" (will only find "john")

0 votes
Travis Alexander [Empyra] January 27, 2022

.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events