need to write a behavior to copy a field value from parent to subtask

Jeetendra Dash December 10, 2018

We created a custom filed named as Requested Version which is of type Version Picker.
We set it in parent issue.Now on create screen of sub-task we need to copy value of Requested Version from parent.

I tried the ways as per below link but failed
https://scriptrunner.adaptavist.com/5.3.9/jira/behaviours-api-quickref.html

Could you please help here?

1 answer

0 votes
Joshwa Marcalle
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 10, 2018

Hi Jeetendra, 

Not sure if this can be made out of the box. 

There is a way for you to automatically create subtasks that inherit the version number from the parent.

Automatic subtask professional

Hope this helps

Josh

OB1

Jeetendra Dash December 12, 2018

Hello Joshwa,

Thanks for your answer.

But I think you did not get my question.

Let me explain you:

I created a custom field Requested Version which is of type Version Picker.

I want to copy the selected value of Requested Version from parent to sub-task.

for a fixversion field we can use below code to copy its value from parent to sub-task.

getFieldById(FIX_FOR_VERSIONS).setFormValue(parentIssue.fixVersions*.id).

so i need some kind of code like above.

I tried below piece of code

def optionsManager = ComponentAccessor.getOptionsManager()
def customField = customFieldManager.getCustomFieldObject(rvFld.getFieldId())
def config = customField.getRelevantConfig(getIssueContext())
def options = optionsManager.getOptions(config)

but it did not work

Could you please help me?

Thanks

Jeetendra

 

 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events