I am trying to add sprint end date and start date custom fields. I though I could do that by:
1. Adding a groovy scripted field and update it from the database during workflow transition
2. Database values plugin
I don't see a problem having a scripted field. Here's code that works for me.
Use the "date time range indexer", and the "date" template:
import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.issue.Issue def customFieldManager = ComponentAccessor.getCustomFieldManager() def sprintCf = customFieldManager.getCustomFieldObjectByName("Sprint") Issue issue = issue issue.getCustomFieldValue(sprintCf)?.startDate?.first()?.toDate()
Okay this works now for JIRA 7 if I use getCustomFieldObject and use the ID instead of name.
I think you misunderstand me. The script should work right now. The type checking errors you can just ignore, or cast to the correct type, but that's more complex.
1. If you are updating the field during transition - you don't need the scripted field - it would be ok to have readonly field
2. Please also think about development of your plugin with calculated field - as for me it can be easier maintained during upgrade routines.
Hello Atlassian Community! My name is Emilee, and I’m a Product Marketing Manager for the Marketplace team. Starting with this post, I'm kicking off a monthly series of Spotlights to highlight Ma...
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!
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
We're bringing product updates and pro tips on teamwork to ten cities around the world.Save your spot