Versions Compared

Key

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


UI Text Box
sizemedium
typeinfo

This function returns the result of a given JMESPATH JMESPath which is applied to a JSON as a text. In case a number, a list, a JSON object or a logical value is returned by JMESPATHJMESPath, the returned text of the function getFromJSON() can be converted accordingly, e.g. with toStringList().

It unfolds its power when combined with the post function Execute remote action, where fields are set with the response of the executed action (or parts of it).


Code Block
languagebash
titleSyntax
linenumberstrue
getFromJSON(JSONString, JMESPATHJMESPath) #Output: Text 


UI Expand
titleExamples


Parser expressionDescription



Code Block
languagebash
linenumberstrue
%{getFromJSON(%{issue.cf10011},"key")}


Customfield 10011 is a multiline text field and holds the result of a previously executed action (by Execute remote action) which created a project in a Jira instance:


Code Block
{
    "self": "https://your-instance.atlassian.net/rest/api/3/project/10020",
    "id": 10020,
    "key": "PRJ"
}

This example returns:
PRJ


Code Block
languagebash
linenumberstrue
%{getFromJSON("{\"key\":\"value\"}","key")}


In this case, a JSON is given as text - quotes have to be escaped with \

This example returns:
Value



UI Expand
titleAdditional information

Parameters used in this function

ParameterInput (data type)Description
JSONString

Status
subtletrue
titletext

Any JSON which is converted to a text, e.g. by writing it as a parser expression or receiving it using the field code %{action.response}


(warning) The text is not checked for syntactical correctness when defining it in the parser expression editor, i.e. if it does not hold a JSON, this is only detected during runtime.

JMESPATHJMESPath

Status
subtletrue
titletext

This parameter holds the JMESPATH JMESPath which is applied to the JSONString.


(warning)
 The text is not checked for syntactical correctness when defining it in the parser expression editor, i.e. if it does not hold a JMESPATH JMESPath, this is only detected during runtime.



UI Expand
titleOutput

This function returns a 

Status
subtletrue
titletext
 



Use cases and examples

Page properties report
firstcolumnUse case
headingsJWT feature, Workflow function, Field type, Automated action, Parser functions
cqllabel = "parser_func_getfromjson" and space = currentSpace()


Page properties
hiddentrue



Status
Tech review

Status
colourYellow
titleReady for review

Style guide

Status
colourYellow
titleReady for review

Status
titletodo
Status
colourYellow
titleReady for review
Status
colourGreen
titledone
Status
colourRed
titleflagged



Page properties
hiddentrue


Short description

Returns the result of a given JMESPath which is applied to a JSON

Output

Status
subtletrue
titletext
 

Label