Hello,
Is it possible to copy custom field values without changing the updated date? I know that there is a buil-in script in Script Runner that does it but it doesn't allow to copy values from single select list into text field. And I need just that.
I wanted to use pretty simple script for copying values:
issues.each { def cf1 = cfm.getCustomFieldObject('customfield_12187').getValue(it).toString() def cf2 = cfm.getCustomFieldObject('customfield_11704') it.setCustomFieldValue(cf2,cf1) issueManager.updateIssue(user, it, EventDispatchOption.DO_NOT_DISPATCH, false) }
But it changes Updated Date in each issue and that is very unwelcome for setting in 10k issues that I need to update.
Any ideas how to do it without messing with the database?
Regards,
Bartek
Hello Bartek.
Before recommending you anything, I would advise you create a test project in which to test the two methods I'm about to recommend, so that you don't break anything in case I'm wrong :D
I have asked a senior in my team, and they've recommended you use com.atlassian.jira.issue.IssueManager#updateIssue with the eventDispatcher off. That should not trigger an event, and hence, it shouldn't update the date.
Also, you could test in one testing project the BulkFixResolutions canned script. It shouldn't update the date, but I cannot be 100% sure. Give it a test and let me know if it helped.
Cheers!
DYelamos
Hi Daniel,
As you might see in my question I've used method you metioned and I've already tested it and it doesn't work like that. Indeed it doesn't fire an event but nevertheless it changes the Updated Date.
And yeah, your built-in scripts can update issues without changing Updated Date but any of the built-in scripts can copy custom field values from single select to text field.
So, still looking for a solution...
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.