Is there a way to determine whether a custom field was updated during an edit (not workflow transition)? Basically, I want to update a scripted field to the current date if customfield_##### was updated during the edit. Thanks.
Community moderators have prevented the ability to post new answers.
Hello,
you could write a simple script that manage ISSUE_UPDATED event. During the issue update this field could be set to the current date.
Hope this helps,
Fabio
import com.opensymphony.workflow.WorkflowContext
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.ComponentManager
import com.atlassian.jira.event.issue.AbstractIssueEventListener
import com.atlassian.jira.event.issue.IssueEvent
import org.apache.log4j.Logger
import static org.apache.log4j.Level.DEBUG
import com.atlassian.jira.bc.issue.IssueService.UpdateValidationResult
import com.atlassian.jira.bc.issue.IssueService.IssueResult
import com.atlassian.jira.bc.issue.IssueService
import com.atlassian.jira.bc.issue.IssueService.TransitionValidationResult
import com.atlassian.jira.issue.IssueInputParametersImpl
import com.atlassian.jira.issue.IssueInputParameters
import com.atlassian.jira.util.ErrorCollection
import com.atlassian.jira.issue.index.IssueIndexManager
class invoketransition extends AbstractIssueEventListener {
Logger log = Logger.getLogger(invoketransition.class)
@Override
void issueUpdated (IssueEvent event) {
log.setLevel(org.apache.log4j.Level.DEBUG)
def field = event.getChangeLog().getRelated('ChildChangeItem').any{ it.field.toString().equalsIgnoreCase("fieldname")}
if (field){
//your code
}
}
}
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.