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).


getFromJSON(JSONString, JMESPath) #Output: Text 



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



Parameters used in this function

ParameterInput (data type)Description
JSONString

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

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.



This function returns a  



Use cases and examples




Status
Tech review

Style guide




Short description

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

Output

 

Label