Hi All,
Jira is making me want to blow my own brains out again....
Am using the below script to update a custom field with a given date.
This is a script runner post-funtion that when applied to any other workflow transition, works just fine, but when i apply it to the create transition;
The script runs and does not log any error but the field does not update the field.
Why does this work fine on one transition but not on another, i don't understand. :-(
-----------------------
//The below ScriptRunner post-function adds a specific number of days e.g. 365 to a custom field.
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.CustomFieldManager
import java.sql.Timestamp
Issue issue = issue
def customFieldManager = ComponentAccessor.getCustomFieldManager()
//define the dependent custom field
def dateACF = customFieldManager.getCustomFieldObjectByName("Forecast Date")
// Get today's date to s
def today = new Timestamp(new Date().time)
// build the new date
def dateB = today.plus(180)
//write back to custom field
issue.setCustomFieldValue(dateACF,dateB)
--------------------
What order are you placing this in within the post functions?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.