Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Need help with Structure for Jira Expr advanced expression - use of statusCategory attribute

Bruce Bowers December 4, 2023

I am using Structure for Jira. I want to define an Expr expression to display the open issues that this issue is dependent on. I have a working expression for displaying all issues that this issue is dependent on:

WITH _format(issue) = """[${issue.key}|${issue.url}]""" :
issuelinks
.FILTER($.type = 'Dependency' AND $.source = this)
.MAP(_format($.destination))

However, if I try to change the filter to display only the open issues using the statusCategory attribute, it doesn't work:

WITH _format(issue) = """[${issue.key}|${issue.url}]""" :
issuelinks
.FILTER($.type = 'Dependency' AND $.source = this AND $.destination.statusCategory != 'Done')
.MAP(_format($.destination))

I would expect the attribute statusCategory to have one of the following values:  "To Do", "In Progress", or "Done".  However, the expression above doesn't work.  Is statusCategory the right name for this attribute in Expr?  Is there something else I am doing wrong?

1 answer

1 accepted

1 vote
Answer accepted
Stepan Kholodov _Tempo_
Community Champion
December 5, 2023

Hello @Bruce Bowers 

You can try this formula:

WITH _format(issue) = """[${issue.key}|${issue.url}]""" :
issuelinks
.FILTER($.type = 'Dependency' AND $.source = this)
.MAP(if $.destination.status.category != "Done" :_format($.destination))

I hope this helps. If you need further assistance or have other questions about Structure - please reach out to us directly at our support portal and we'll get back to you shortly.

Best regards,
Stepan
Tempo (the Structure app vendor)

Bruce Bowers December 5, 2023

Thanks, Stepan!  I actually used a slightly different expression based on your advice, but it worked fine:

WITH _format(issue) = """[${issue.key}|${issue.url}]""" :
issuelinks
  .FILTER($.type = 'Dependency' AND $.source = this AND $.destination.status.category != 'Done') 
  .MAP(_format($.destination))

I will try to register for Tempo Customer Support, if I can get the SEN number from our Jira administrators (we are on Structure for Jira v8.0.1.)

Follow up question:  I am familiar with the attribute names used in Jira queries.  There are some differences when those attributes are used in Expr.  Is there a reference with a mapping from Jira query attribute names (e.g., statusCategory) to the names used in Expr (e.g., status.category)?

Like Stepan Kholodov _Tempo_ likes this
Stepan Kholodov _Tempo_
Community Champion
December 6, 2023

@Bruce Bowers 

Yes, the Expr language is not the same as JQL if it's what you mean. You can find out more details about it on our Wiki, including available functions/properties and sample formulas.

Best regards,
Stepan

Suggest an answer

Log in or Sign up to answer