Hi everyone,
A while back Kristian Walker from Adaptavist published an example script for clearing fields in cloned issues: https://bitbucket.org/snippets/Adaptavist/ynXxME
Unfortunately, there was no definition for the "Checkbox" field type (from the script):
// Specify the custom field names below for the Single Line Text Field ensuring the < and > characters are removed. def singleLineTextField = customFields.find { it.name == '<SpecifyTheCustomFieldNameHere>' }?.id def numberField = customFields.find { it.name == '<SpecifyTheCustomFieldNameHere>' }?.id def singleSelectListField = customFields.find { it.name == '<SpecifyTheCustomFieldNameHere>' }?.id
I couldn't find it anywhere (I admit, I am not a JIRA developer, so scripting is not my thing).
Could anyone (Kristian?) please let me know how it would look like? Also, in that example script Kristian was clearing "Comments" field without defining it in the def section. Do I treat "Sprint" filed the same way, as both of them are default fields.
I would greatly appreciate any help I could get. Thank you in advance.
Hi Gregory,
I can confirm that I have updated the snippet linked above so that it clears checkbox fields and the sprint field now.
Please note in Jira the sprint field is treated as a custom field so the script gets this on line 27 and gets the checkbox field on line 26 where you must specify the name of your checkbox field.
These are then set to null in the body of the rest call on line 30 to clear the values.
In the body of the clearValues rest call you can comment out any fields you do not wish to clear.
I hope this helps.
Regards,
Kristian
@Kristian Walker _Adaptavist_ Thank you so much. I'll give it a try and let you know how it goes. Appreciate all your help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Kristian,
This thing worked like a charm. I truly appreciate your assistance. You are the best.
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.