Hi,
I am a new Jira Admin. I have a self-hosted system on version 7.2.3 and script runner on version 5.3.1.
Previous admin have created an automation according to which they can clone bugs to HotFixes upon request. The HF created inherits all fields from the parent issue(bug).
They have now come up with a request, demanding that the Original Estimate field should be purged to the child issue(HF). I have tried:
def cf = customFieldManager.getCustomFieldObjects(issue).find {it.name == 'Original Estimate'} issue.setCustomFieldValue(cf, null)
but it doesn't function.
Any ideas about this?
Try to change your script to this one
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.event.type.EventDispatchOption
def user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
def cf = customFieldManager.getCustomFieldObjects(issue).find {it.name == 'MyCustomFieldType'}
issue.setCustomFieldValue(cf, 'my value')
ComponentAccessor.getIssueManager().updateIssue(user, issue, EventDispatchOption.ISSUE_UPDATED, false)
Thanks a lot for your reply but it doesn't function.
I think the problem is with issue.setCustomField value
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You put your script in the Condition part, but you need to put your script into the Additional Issue Actions part
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Even though I put script to the "additional conditions", the clone is not created at all.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What is in the Codition field right now?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
isUserMemberOfRole('Project Owner') && cfValues['HotFix Required']?.value == 'Approved'
I believe this happens cause for build-in fields there is a box where you can select what to inherit to child issue.
All those lines we are trying to make work are usefull only for custom fields.
I believe this is the key that was missing all those days. What do you think?
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.