Just upgrade to JIRA 7.0.2 and my old custom field is gone, which did the above.
Looked at scriptrunner, but couldn't get it working. Any ideas?
Script runner can do it, and it's quite easy to do as well - I've got a feeling it's a one-line scripted field.
What have you tried there?
See the script on https://scriptrunner.adaptavist.com/latest/jira/scripted-fields.html#_calculate_a_number_based_on_other_fields for how to calculate the number of attachments.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Tried the example from scriptrunner, as Phill mentions. but it doesnt work.
I see now that it has been superseeded by hasAttachments. jql function. But it doesnt make any sense to me with my lack of programmingskills. I can see how it can be used to make a query but not to pull the actual count in a custom field.
Do you have any examples?
Thanks for taking your time.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As Phill may be at lunch, the script on that page needs updating as it was written for JIRA 6 @Thanos Batagiannis [Adaptavist] gave us a new one: import com.atlassian.jira.component.ComponentAccessor def attachmentManager = ComponentAccessor.getAttachmentManager() def numberAttachments = attachmentManager.getAttachments(issue).size() // use the following instead for number of PDFs //def numberAttachments = attachmentManager.getAttachments(issue).findAll {a -> // a.filename.toLowerCase().endsWith(".pdf") //}.size() return numberAttachments ? numberAttachments as Double : null
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.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.