Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This page explains how to access the value of Standard JIRA Jira fields using Nunjucks. Each field's structure is explained with examples. To understand how to write values into these fields see, Text input for fields and JSON input for fields.

...

Panel
borderStylesolid

Issue type

  • Field name : Issue Type

  • Key: issuetype

  • Description : The Issue Type field is an object describing the issue type.

  • Structure :

    Expand
    titleClick here to see the structure of the Issue type field


    Section


    Column


    Code Block
    titleStructure
    linenumberstrue
    "issue":
    {
    	...
    	...
    	"fields":
    	{
    		...
    		...
    		"issuetype":
            {
                "self":String, //URL of the Issue type.
                "id":String, //ID of the Issue type.
                "description":String, //Description of the Issue type.
                "iconUrl":String, //URL of the Issue type icon
                "name":String, //Name of the Issue Type.
                "subtask": "Boolean", //True when issue is a sub-task.
                "avatarId": Number, //Number of the avatar ID of the issue.
            },
    		...
    	}
    	...
    }



    Column
    width700px


    Code Block
    titleExample
    linenumberstrue
    "issue":
    {
    	...
    	...
    	"fields":
    	{
    		...
    		...
    		"issuetype":
    		{
    			"self":"https://jmwe-test-2.atlassian.net/rest/api/2/issuetype/10001",
    			"id":"10001",
    			"description":"A user story. Created by JIRAJira Software - do not edit or delete.",
    			"iconUrl":"https://jmwe-test-2.atlassian.net/images/icons/issuetypes/story.svg",
    			"name":"Story",
    			"subtask":false,
    			"avatarId":3.0
    		},
    		...
    	}
    	...
    }





  • Accessing the Issue type field
    • Name of the issue type : {{issue.fields.issuetype.name}}

    • Set a text field to "This issue is a sub-task" if the issue is a sub-task :

      Code Block
      {% if issue.fields.issuetype.subtask == true %}
      	This issue is a sub-task
      {% else %}
      	This issue is not a sub-task
      {% endif %}
      


...