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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.ComponentAccessor
import com.atlassian.jira.workflow.TransitionOptions
import com.atlassian.jira.workflow.IssueWorkflowManager
import org.apache.log4j.Logger
import org.apache.log4j.Level
import java.sql.Timestamp
import com.atlassian.jira.event.type.EventDispatchOption
log.setLevel(Level.DEBUG);
// Field ID: 10900
def 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)
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.