You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hello Community
I am using a ScriptRunner JQL to find issue which have been created after the "Start Date" custom field.
issueFunction in dateCompare("", "created > Start Date")
This works well but now we run into a problem due to having two custom fields of the same type with the same name.
Does anyone how whether I can reference the customfield ID in the query rather than the name?
Also, I am fully aware that the correct way would be to clean up our Jira and avoid two custom fields of the same type and name but I need a shortcut now.
Many thanks
Hi Nadine,
Using custom field's IDs rather than their names is a really good choice. Custom fields will have their ID next to the name of the field when suggesting fields in JQL like cf[12345]:
So for example, if "Start Date" was cf[12345] you could have:
issueFunction in dateCompare("", "created > cf[12345]")
Please give it a try and let me know how it goes. I hope it helps.
Cheers,
Carlos
Hello @carlosughini
Thanks a lot for the suggestion.
I am afraid it does not work for me though
Message: Field name: cf[16300] not found or not a date or datetime
The ID is correct so it must either be the format or it's generally not possible to use cf IDs here.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey @Nadine Schuett ,
I'm afraid we are facing some type of bug or it is not able to search by id, unfortunately.
I've performed some tests on my side, even using "customfield_id" which is a Groovy code in the JQL, however, with no success.
I strongly recommend a support ticket here so Adaptavist can help you with this issue.
Please give it a try and let me know if you have any issues.
Regards,
Carlos
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @carlosughini
I contacted Adaptavist support and they told me that the dateCompare JQL function does not support search using a custom field ID.
However, I got the advice to use the even more powerful expression function and that works well:
issueFunction in expression("", "created > customfield_16300")
Thanks for your help and have a great day
Nadine
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.