JIRA is now available as three separate applications, JIRA Software, JIRA Service Desk, and JIRA Core. For more information on administering these applications, refer to the Administering JIRA Applications documentation.

Setting Priority field value based on customfield value

Please note that adding Javascript to custom fields is a customisation and not maintained as a supported part of JIRA.

Check the comments below. This page has been flagged as outdated.

As the users are neglecting the description of the Priority field, a more detail custom field is created to represent the Priority field. Depending on the radio button custom field selected, the Priority field value is set.

  1. Create a customfield name "Severity" at Browse >> Administration >> Issue Fields >> Custom Fields
  2. Configure the radio button custom field to have a field options
  3. Check the customfield ID in the Customfield table from the database by using the following SQL query:

  4. Modify the following javascript code so that <id>will be replaced with the id of the custom field found from the first step:

  5. Paste the javascript into the description of the "Severity" customfield at Browse >> Administration >> Issue Fields >> Custom Fields.

There is no need to hide or remove the 'Priority' field from the screen. The javascript code will hide the Priority field by itself.

Was this helpful?

Thanks for your feedback!

Why was this unhelpful?

11 Archived comments

  1. User avatar


    On Jira 4.2, the naming of the customfield contains a '-' instead of a '_' in the end. The following snippet is working here with customfield id = 10133:


    Tom Moors [ACA IT-Solutions]

    23 Dec 2010
  2. User avatar


    23 Dec 2010
  3. User avatar


    I have attempted to do this in Jira 4.3 although it is not working. The priority field is not being hidden and the priority is not being changed accordingly once the issue has been submitted. Is there anything else which I need to change or can I just chuck this code into any radio button field once I have modified in my ID?

    Here is my code once modified. The ID for my "Severity" field is 10527.

    12 May 2011
    1. User avatar

      Sanu P Soman

      Is this code will work for select list field ???

      21 Apr 2012
  4. User avatar


    I have tried implementing this example in 4.3. with the customfield containing a '-' instead of a '_' in the end, but it is not working. Any recommendations?


    Velina Urdova

    24 May 2011
  5. User avatar

    Justin Downing

    This article is a bit out-of-date and should be updated. Also, it seems SAC implements this solution differenty, and arguably, in an easier way.

    1. You don't need to create a seperate custom field. First, go the the Field Configuration for the project and Edit the Description of the Priority field with:


    2.  Make sure the Priority is visible on the Create Issue screen for your project.

    3. You're done. (smile)

    02 Dec 2011
  6. User avatar

    Sanu P Soman

    Hi Justin,

    I've tried this code and its working only at create screen, after putting the value in "Severity of Problem" field its been not reflecting in view screen. There showing same priority field with common values. Please suggest?

    Many thanks in advance.

    Sanu P Soman

    21 Apr 2012
  7. User avatar


    hey I tried using this code in the description, but it doesnt work for me? I am using JIRA 4.1.2 can anyone suggest if JIRA 4.1.2 supports this? Thanks

    <script type="text/javascript" charset="utf-8" id="priorityCustomFieldScript">   
    function setIssuePriorityAndSubmit(e)   
    // set the value of the priority field here:   
     {        document.getElementById("priority").selectedIndex = 0; 


    function hidePriorityAndAddSeverityHook()   
    {    var row = document.getElementById("priorityFieldArea");   
    row.style.display = 'none';    


    var currentLocation = window.location.href;   
    if (currentLocation.indexOf('CreateIssue') > -1 || currentLocation.indexOf('EditIssue') > -1) {     


    05 Jul 2012
  8. User avatar

    Phil Brady

    Is there a way to do something similar to this in on demand?

    Maybe using post functions in the workflow. If a custom field is set to "Site down" then priority is set yo "Urgent"

    26 Oct 2012
  9. User avatar

    Kevin Floyd

    We are running:  JIRA v6.3-OD-06-017

    I would like to replace the priority with numbers such that each epic has stories that are prioritized numerically.

    Is this method the correct approach?

    thank you,


    18 Jun 2014
  10. User avatar

    Aaron Zammit

    Is this feature available on the cloud version of Jira?


    Ref: Setting Priority field value based on customfield value

    09 Jul 2015
Powered by Confluence and Scroll Viewport