Inline editing validation


I have a field(FieldDest) which can take certain values based on value selected for another field(FieldSource). I can enforce the selection on issue creation by using validators.

However when a user does in-line edit after issue creation, how can I add validation ( cannot add as post function for every transition).

Since I know FeildSource when user is editing FieldDest inline, is there a way I can show only values relevant to current selection of FieldSource. (FieldDest is a custom filed, FieldSource is a JIRA default field like Component).

Please let me know.



4 answers


If this can help you, us we are using a script that change a field depending on priority.

After that we disable the field inline editing ONLY for those 2 field, so they are forced to use Create or Edit.

<script type="text/javascript">
var path = window.location.pathname;
if (path.substring(path.lastIndexOf('/') + 1).indexOf('BulkEditDetails.jspa') > -1)
     document.write("\n<H4>ATTENTION<BR><BR>To Bulk Edit Ubi Priority, you must specify Severity & Probability.</H4>");

var S1 = 1
var S2 = 2
var S3 = 3
var Sunset = 0
var P0 = 0
var P1 = 1
var P2 = 2
var P3 = 3
var Punset = 4

function setUnsetValue(priorityUbiField)
     priorityUbiField.selectedIndex = 11;

var removeCTE = setInterval(function() {

    var priorityField = document.getElementById("priority");
    var priorityUbiField = document.getElementById("customfield_10220");

        if(priorityField.selectedIndex == P0)
            priorityUbiField.selectedIndex = 1;
	    else if(priorityField.selectedIndex == P1)
                priorityUbiField.selectedIndex = 2;
	else if(priorityField.selectedIndex == P2)
                priorityUbiField.selectedIndex = 5;

	else if(priorityField.selectedIndex == P3)
                priorityUbiField.selectedIndex = 8;
        else  //Unset

    return true;


var dialog = new AJS.Dialog({width:1200, height:730});
              // adds header for first page
                dialog.addHeader("Ubi Priority");
                // add panel Ubi Priority
                dialog.addPanel("Ubi Priority", "<img src='/jira/ubimages/icons/Ubipriority/UPV3/UPV3.PNG' width='869' height='597' longdesc='' />", "panel-body");
                // add panel Severity and Prob
                 dialog.addPanel("Severity", "<img src='/jira/ubimages/icons/Ubipriority/SeverityV3/UP3_Bug_Severity_Reminder.png' width='720' height='433'  longdesc='' /> ", "panel-body");
     		  dialog.addPanel("Probability", "<img src='/jira/ubimages/icons/Ubipriority/ProbabilityV3/UP3_Bug_Probability_Reminder.png' width='720' height='526'  longdesc='' /> ", "panel-body");

                dialog.addButton("Cancel", function (dialog) {

                AJS.$("#ubip-button").click(function() {

                    <input id="ubip-button" name="ubip-button" type="button" class="button" value="UbiP Help">

Disabled 1 field for inline editing

Description of the code that was executed before the problem occured
<script type="text/javascript">
var removeCTE = setInterval(function() {
var clickToEditElm = $('[class*="editable-field inactive"][id*="customfield_10100-val"]');

        for (var j=0; j < clickToEditElm.length; j++)
           var thisClickToEditElm = clickToEditElm[j];

            thisClickToEditElm.className = thisClickToEditElm.className.replace("editable-field inactive","editable-field");  
            thisClickToEditElm.title = "";


I have similar issue here as well. I have a custom field where I wanted to do a validation of the value during in-line edit based on component field values. For normal "Edit", I do a check on the AJS.$("#component") field in javascript to check the values.

For inline edit, I see the HTML is using a div with id wrap and a span like below and I wanted to get the value in the href (namely the value "Component1"). How do I do with javascript?

<li class="item"><div class="wrap"><strong class="name">Component/s:</strong><span id="components-val" class="value"><span class="shorten" id="components-field"><a href="/jira/browse/PRJB/component/10005" title="Component1 ">Component1</a>, <a href="/jira/browse/PRJB/component/10006" title="Component2 ">Component2</a></span></span></div>

0 votes

Try something like this:


Haven't tested it!

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Mar 13, 2019 in Marketplace Apps

Marketplace Spotlight: Marketing apps for Confluence to keep your teams working on the same page


246 views 0 6
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