include scripted field of type date in dateCompare jql function

Hi @Jamie Echlin [Adaptavist],

I have issues with a SR scripted field with Date Time search template and Date Time return value. Is it possible to use such custom field in IssueFunction in dateCompare(... JQL function? If not, is it possible to improve the function to include scripted field when the expected return type is a date?

Using JIRA 7.0.10 and SR 4.3.3

 

My use case : I have a review issue per version, each confirmed review issue has an expected deploiement date. and each confirmed review issue is linked to autocreated deployement issues present in a separat project (a deployment issue per environnement type : test, preproduction, production... etc).

Now each deployement issue, has a scripted field that gets the "Expected deploiement date" on the review issue.

I wish to use this scripted field to make somme JQL queries. Ex. "Scripted Expected deploiement date < duedate +2w"

 

Thank You,

 

 

2 answers

1 accepted

1 vote

You could try the "expression" function as it's a bit more flexible. But I think neither work with script fields. There are outstanding issues for this - perhaps https://productsupport.adaptavist.com/browse/SRJIRA-1907

I tried to use the "expression" function, but had this :

  • "Field Qualification not found or not a Number or Date custom field." : I think that expression is looking for date type as in compareDate.

and another problem is : 

  • When the name of the field has spaces, "expression" function has problems parsing it, Error message : "unexpected token: date @ line 1, column 15." when trying something like : 

    JQL : 

    issuetype = deploy and issuefunction in expression("", "Qualification date > today")

     

  • and if the field name is more complicated, JQL : 

    issuetype = deploy and issuefunction in expression("", "Qualification date de mep souhaitée > today")
     

    I have this error : "expecting EOF, found 'souhaitée' @ line 1, column 27."

     

     

 

 

You could create more one scripted field on number type to culcalate date difference between respetive date into issues and then use this field into JQL

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Julia Dillon
Posted Apr 17, 2018 in Jira

Tell us how your team runs on Jira!

Hey Atlassian Community! Today we are launching a bunch of customer stories about the amazing work teams, like Dropbox and Twilio, are doing with Jira. You can check out the stories here. The thi...

800 views 2 19
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you