Hi,
I would like to calculate the lifetime of a product based on the difference between when the product has been released (custom field Launch date) and now.
I was trying to do it with the duration scripted field in scriptrunner but I have an issue :
((System.currentTimeMillis() - customField[14311].getTime())/1000).toLong()
Here is the error message :
groovy.lang.MissingMethodException: No signature of method: com.atlassian.jira.issue.fields.ImmutableCustomField.getAt() is applicable for argument types: (Integer) values: [14311] Possible solutions: getAt(java.lang.String), getId(), getName(), putAt(java.lang.String, java.lang.Object), wait(), grep() at Script101.run(Script101.groovy:1)
Can anyone help ?
Thank you
I figured it out, here is the final code :
((System.currentTimeMillis() - getCustomFieldValue('Launch Date').getTime())/1000).toLong()
Thanks for your time Ravi :)
Arthur
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What I am trying to do is to create a custom scripted field on "Duration" template.
When I do it this way :
((System.currentTimeMillis() - issue.created.getTime())/1000).toLong()
I have the following result :
48 weeks, 13 hours, 36 minutes
But instead of comparing it to the created date, I would like to compare it to my custom field "Launch Date".
For my understanding, this is giving me the field value :
customField[14311]
but I am not sure how to convert it to the right type to compare it to System.currentTimeMillis()
Thanks,
Arthur
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.