Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Set Parent issue single select custom field to None upon transition

Harish_Kumar April 23, 2020

Hi Team,

after i click on transition which creates a new issuetype in the same project and it copies parent issue single select custom field to this, then I wanted to set parent Single select custom field value to None in post function. please help me as i got stuck here.

 

Thanks in advance

Harish Kumar

1 answer

0 votes
Leo
Community Champion
April 25, 2020

Hi @Harish_Kumar,

You may need to use below code in your script to clear select list field value, place it after copy/clone script 

def cfSelect = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Select List Field")
issue.setCustomFieldValue(cfSelect, null)

 Hope this helps

 

BR,

Leo

Harish_Kumar April 25, 2020

Hi @Leo , Already In the transition i have a code which creates a new issuetype within the same project with the custom field value copied to it. at this point i need the custom field set to null after copied to new issuetype.

The code you mentioned is clearing the value to null , but this is applied to new issue. I need to apply this to parent issue , after the creation of new issue.

 

Thankyou

Harish Kumar

Leo
Community Champion
April 27, 2020

@Harish_Kumar , can you post your script here to have a look

 

BR,

Leo

Harish_Kumar April 27, 2020

@Leo Hi, I used built in script "clone issue script" . I used mine in a separate post function script console. the code you posted.

Leo
Community Champion
April 27, 2020

Hi @Harish_Kumar,

Is it on the same transition where you added clone function? is your parent/original issue holds the value still? also can you check the order of the of function? 

Suggest an answer

Log in or Sign up to answer