This function returns the result of a given 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 JMESPath, 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).

Syntax
getFromJSON(JSONString, JMESPath) #Output: Text 
Examples
Parser expressionDescription

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:

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

This example returns:
PRJ

getFromJSON("{\"key\":\"value\"}","key")

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

This example returns:
Value

Additional information

Parameters used in this function

ParameterInput (data type)Description
JSONString

TEXT

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.

JMESPath

TEXT

This parameter holds the 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, this is only detected during runtime.

Output

This function returns a TEXT 


Use cases and examples