Forums

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

Show Values in Child Fields When Parent Selected on Create Screen Using Scriptrunner Behavior

Digvijay Singh Gehlot
Contributor
January 21, 2026

Hi Community,

My use-case:

  • On Create screen, there is a Parent field where a user can select a Parent-key and a custom field "Project Version" (which is present on Parent & Child screen). 
  • Parent issue type = Portfolio Epic & Child issue type = Feature

My requirement is:

  • On Create screen, when a user selects a Parent-key in Parent field, the value of Project Version field should be copied from Parent issue and displayed on Child issue automatically.
  • That is, whenever there is a change of Parent-Key on Child, the respective value of Project Version should be copied from Parent field and display in Child field.

Please guide on how to code the above configuration on Create screen using Scriptrunner Behavior for Jira Cloud and Any sample code will be a great help to build the same logic.

Thanks 

3 answers

0 votes
Madhumitha N
January 21, 2026

Hello @Digvijay Singh Gehlot , 

Replace customfield_12345 with the actual custom field ID of "Project Version" and give this a try.

 

// Copy "Project Version" from Parent issue to Child issue on Create screen

const parentField = getFieldById("parent");
const projectVersionField = getFieldById("customfield_12345");

async function run() {
parentField.on("change", async () => {
const parentKey = parentField.getValue();

if (!parentKey) {
projectVersionField.setValue(null);
return;
}

const parentIssueRes = await makeRequest(`/rest/api/2/issue/${parentKey}`);
if (!parentIssueRes || parentIssueRes.status !== 200) {
logger.warn(`Could not fetch Parent issue ${parentKey}, status=${parentIssueRes?.status}`);
return;
}

const parentIssue = parentIssueRes.body;

const parentProjectVersion = parentIssue.fields["customfield_12345"];

projectVersionField.setValue(parentProjectVersion || null);
});
}

await run();

 

0 votes
Adam Mason
January 21, 2026

Is it really needed on the Create screen to allow the user to adjust it, or will it always be the Project Version from the parent?

If the latter, there's a far simpler solution using automation rules. You could create an automation rule to trigger when a work item is created, then simply write the value from the parent to the children. You could even detect changes to that field on the parent and cascade them to the children whenever it changes - effectively syncing it. 

Another option on that same thought process is using a Scripted Field in Scriptrunner, but it's a little more complicated if you're not too familiar.

Food for thought :) 

Digvijay Singh Gehlot
Contributor
January 21, 2026

Hi @Adam Mason 

Thank you for your message. 

Yes, as per customer requirement, user should have the flexibility to change the Parent-key in Parent field so that they can see what values are coming from the Parent issue to Child fields on field value change on Create screen and decide which Parent they have to select before submitting a new Child issue.

I have configured and tested that suggested Jira rule but the changes are happening after the Child issue is created. But requirement is, user should see the values of Parent fields on Child issue as soon as a Parent-key is selected in Parent field before clicking on Create button on Create screen. 

It would be great if you can help me with Scripted field - sample code in Scriptrunner to achieve my use-case?

Thanks 

0 votes
Digvijay Singh Gehlot
Contributor
January 21, 2026

Hi @Ram Kumar Aravindakshan _Adaptavist_ ,

Thank you for helping me out with similar use case in Jira DC: https://community.atlassian.com/forums/Jira-questions/Copy-Parent-Field-Values-to-Child-When-Selecting-Parent-in/qaa-p/3016022#M1123744

May you also guide me with the sample code for Scriptrunner Behavior for Jira Cloud?

Thanks in advance.

Suggest an answer

Log in or Sign up to answer