I need to set a a custom date field (Date Returned), when a Resolution is set to "Rework Needed". I am unclear where to do this. Post Functions do not appear to be the correct location.
This definitely is a job for a post-function (or automation), but you'll need an app to do it.
A post-function is more than capable of running on the "move issue to done" transition where you ask the user to choose a resolution, take a look at what they choose, and then setting a (presumably future) date on it.
Also possible with (again a scripted/custom) listener, but a post-function is the best option - easiest code and most efficient.
Hi @Jeff Abbott
I'm not sure this can be done without using an app from the marketplace. Do you have any apps added on to your instance?
Thanks,
Tim
I got this working using ScriptRunner. I use a post function to set the appropriate data field after each transition.
import com.atlassian.jira.component.ComponentAccessorimport com.atlassian.jira.workflow.TransitionOptionsimport com.atlassian.jira.workflow.IssueWorkflowManagerimport org.apache.log4j.Loggerimport org.apache.log4j.Levelimport java.sql.Timestampimport com.atlassian.jira.event.type.EventDispatchOptionlog.setLevel(Level.DEBUG);// Field ID: 10900def issueManager = ComponentAccessor.getIssueManager();def customFieldManager = ComponentAccessor.getCustomFieldManager()def user = issue.getCreator()def dateCf = customFieldManager.getCustomFieldObject(10900)issue.setCustomFieldValue(dateCf, new Timestamp((new Date()).time))issueManager.updateIssue(user, issue, EventDispatchOption.DO_NOT_DISPATCH, false)
@Tim Perrault , I used Script Runner
It looks like you're new here. Sign in or register to get started.