Versions Compared

Key

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

...

Panel
borderStylesolid

Approvers

  • Field name: Approvers

  • Description: The Approvers field is an array of object. Each object represents an approver.

  • Structure:

    Expand
    titleClick here to see the structure of the Approvers field


    Section


    Column


    Code Block
    titleStructure
    linenumberstrue
    "issue":
    {
    	...
    	...
    	"fields":
    	{
    		...
    		...
    		"customfield_xxxxx":
    		[
    			{
    				"self": String, //URL of the approver
    				"nameaccountId": String, //Name of the approver
    				"key": String, //KeyAccountId of the approver
    				"emailAddress": String, //Email address of the approver
    				"avatarUrls": //URLs of approver avatar
    				{
    					"48x48": String,
    					"24x24": String,
    					"16x16": String,
    					"32x32": String
    				},
    				"displayName": String, //Display name of the approver
    				"active": Boolean, //True if approver is active
    				"timeZone": String, //Timezone of the approver
    				"accountType": String //Account type
    			},
    			{
    				//Second approver details and so on..
    			}			
    		],
    		...
    	}
    	...
    }



    Column
    width700px


    Code Block
    titleExample
    linenumberstrue
    "issue":
    {
    	...
    	...
    	"fields":
    	{
    		...
    		...
    		"customfield_10100":
    		[
    			{
    				"self": "https://jmwe-test-2validationenvironment.atlassian.net/rest/api/2/user?usernameaccountId=Corners5ca5b1469a000c1180956957",
    				"nameaccountId":"Corners", 				"key":"corner""accountId:5ca5b1469a000c1180956957",
    				"emailAddress":"c@gmail.com",
    				"avatarUrls":
    				{
    					"48x48":"https://secure.gravatar.com/avatar/316a26014c6e203f76d222f326462753?d=mm&s=48",
    					"24x24":"https://secure.gravatar.com/avatar/316a26014c6e203f76d222f326462753?d=mm&s=24",
    					"16x16":"https://secure.gravatar.com/avatar/316a26014c6e203f76d222f326462753?d=mm&s=16",
    					"32x32":"https://secure.gravatar.com/avatar/316a26014c6e203f76d222f326462753?d=mm&s=32"
    				},
    				"displayName":"Corners",
    				"active":true,
    				"timeZone":"Europe/Berlin",
    				"accountType": "atlassian"
    			},
    			{
    				//Second approver details and so on..
    			},			
    		],
    		...
    	}
    	...
    }





  • Accessing the Approvers field
    • Name of the last approver of the issue: {{ issue.fields.Approvers | last |field("nameaccountId") }}

    • On reopening an issue, set the assignee to the user selected on the transition screen, only if the user belongs to the approvers. If not, set the assignee field to the first approver:

      Code Block
      titleExample
      linenumberstrue
      {% set assignee = issue.fields.Assignee.nameaccountId %}
      {% set users = issue.fields.Approvers %}
      {% set var = false %}
      {% for user in users %}
      	{% if user.nameaccountId == assignee %}
      		{% set var = true %}
      	{%endif%}
      {% endfor %}
      	{% set var = true %}
      {% if not var %}
      	{%set firstuser = users | first %}
      	{{ firstuser.nameaccountId }}
      {%endif%}

      Select Ignore empty value option in the post-function configuration, so as to not clear the field if the value is empty or null.

    • Display all the users in the approvers field with their display name and email address separated by a hyphen:

      Code Block
      {% set users = issue.fields.Approvers %}
      {% for user in users %}
      	{{ user.displayName }} - {{ user.emailAddress }}
      {% endfor %}


...

Panel
borderStylesolid

Request participants

  • Field name: Request participants

  • Description: The Request Participants is an array of objects. Each object represents a participant.

  • Structure:

    Expand
    titleClick here to see the structure of the Request Participants field


    Section


    Column


    Code Block
    titleStructure
    linenumberstrue
    "issue":
    {
    	...
    	...
    	"fields":
    	{
    		...
    		...
    		"customfield_xxxxx":
    		[
    			{
    				"self": String, //URL of the participant
    				"name":
    String, //Name of the participant
    				"keyaccountId": String, //KeyAccountId of the participant
    				"emailAddress": String, //Email address of the participant
    				"avatarUrls": //URLs of participant avatar
    				{
    					"48x48": String,
    					"24x24": String,
    					"16x16": String,
    					"32x32": String
    				},
    				"displayName": String, //Display name of the participant
    				"active": Boolean, //True if participant is active
    				"timeZone": String, //Timezone of the participant
    				"accountType": String //Account type 
    			},
    			{
    				//Second participant details and so on..
    			}			
    		],
    		...
    	}
    	...
    }



    Column
    width700px


    Code Block
    titleExample
    linenumberstrue
    "issue":
    {
    	...
    	...
    	"fields":
    	{
    		...
    		...
    		"customfield_10100":
    		[
    			{
    				"self": "https://jmwe-test-2validationenvironment.atlassian.net/rest/api/2/user?usernameaccountId=Corners5ca5b1469a000c1180956957",
    				"nameaccountId":"Corners", 				"key":"corner""accountId:5ca5b1469a000c1180956957",
    				"emailAddress":"c@gmail.com",
    				"avatarUrls":
    				{
    					"48x48":"https://secure.gravatar.com/avatar/316a26014c6e203f76d222f326462753?d=mm&s=48",
    					"24x24":"https://secure.gravatar.com/avatar/316a26014c6e203f76d222f326462753?d=mm&s=24",
    					"16x16":"https://secure.gravatar.com/avatar/316a26014c6e203f76d222f326462753?d=mm&s=16",
    					"32x32":"https://secure.gravatar.com/avatar/316a26014c6e203f76d222f326462753?d=mm&s=32"
    				},
    				"displayName":"Corners",
    				"active":true,
    				"timeZone":"Europe/Berlin",
    				"accountType": "atlassian"
    			},
    			{
    				//Second participant details and so on..
    			},			
    		],
    		...
    	}
    	...
    }





  • Accessing the Request Participants field
    • Name of the first participant: {{ issue.fields['Request participants'] | first | field("nameaccountId") }}


Panel
borderStylesolid

Satisfaction

  • Field name: Satisfaction

  • Description: The Satisfaction field is a string representation of a multi-line text describing the request feedback in Service Desk requests.

  • Structure:

    Expand
    titleClick here to see the structure of the Satisfaction field


    Section


    Column


    Code Block
    titleStructure
    linenumberstrue
    "issue":
    {
    	...
    	...
    	"fields":
    	{
    		...
    		...
    		"customfield_xxxxx": String,
    		...
    	}
    	...
    }



    Column
    width700px


    Code Block
    titleExample
    linenumberstrue
    "issue":
    {
    	...
    	...
    	"fields":
    	{
    		...
    		...
    		"customfield_10025":"com.atlassian.servicedesk.internal.api.customfields.feedback.RequestFeedbackCFValue@d3f24"
    	...
    	}
    	...
    }





  • Accessing the Satisfaction fieldAccessing this field is not of much use.

...