How to auto populate a custom field in create issue screen based on Fix Version selected

Hi Experts,

I am new to JIRA and JQuery, we have a usecase where we need to auto populate a custom field based on the fix version selected in the create issue screen.

We tried to acheive by writting Java Script in Description field but if there is any change in Issue Type the logic in description field is not working. Hence we tried to acheive the use case on creating a custom plugin, when ever the fix version is changed we need to caliculate and auto populate a custom field.

So to identify the change in fix version we use the below JQuery

jQuery(document).ready(function() {

       JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function (e, context) {

              if (AJS.$("#create-issue-dialog").length) {

                     $("#fixVersions-multi-select").change(function(){

                                .... Login to caliculate and auto poupulate custom field

                               });

                 }

        });

});

 

But when we select of Create Option(Create Dialog) is not opening, its unable to identify the Fix version id, we have tried below id's for Fix version but none worked

$("#fixVersions-multi-select")

$("#fixVersions")

$("fixVersions")

$("#fixVersions-textarea")

$("#fixVersions-field")

 

Can someone please help us by providing the Jquery logic to identify the fixversion change each and every time in create issue dialoge.

 

Thanks in advance!!!

             

1 answer

Hi,

Here is in the atlassian KB an article to set a field based on another field. Example would help to see the onchange function implementation.

https://confluence.atlassian.com/display/JIRAKB/How+to+display+a+Field+based+on+another+Field%27s+selection

I am using $("#fixVersions-multi-select") in my validation with jquery.

Hope it helps.

Vijay

Hi Vijay, Thanks for providing very useful information. I tried it and it worked.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published yesterday in Jira Software

How large do you think Jira Software can grow?

Hi Atlassian Community! My name is Shana, and I’m on the Jira Software team. One of the many reasons this Community exists is to connect you to others on similar product journeys or with comparabl...

364 views 4 10
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you