• 0
    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

      Add a feature in Jira Automation to allow for parsing string to json.

      It would be nice to able to turn a string in comments or summary to json object so keys can be referenced somewhere else.

      For example, if the comment says:

       

      {"name":"John"}

      I would like to be able to do this in Automation:

      {{comment.body.toJson().name}}

      or something similar.

      Currently, there are json function in Automation but none of them parse string to json object and let you refer to a key or element.

            [AUTO-138] Add JSON Parser feature in Automation

            Bill Sheboy added a comment - - edited

            Please note well: although the function jsonStringToObject() can translate some basic JSON expressions from text into objects, testing shows it does not consistently allow access to attributes by smart value when iterated over as a list of values.  Instead, text functions must be used with the match() function...dramatically reducing the value of this new conversion function.  That list symptom overlaps with (and is distinct from) this defect where list iteration incorrectly selects item attributes when they are used in operations: https://jira.atlassian.com/browse/AUTO-1674

            I recommend a complete round of testing to confirm what does / does not work with the new function and to document the limitations accordingly.

            Thank you!

            Bill Sheboy added a comment - - edited Please note well : although the function jsonStringToObject() can translate some basic JSON expressions from text into objects, testing shows it does not consistently allow access to attributes by smart value when iterated over as a list of values .  Instead, text functions must be used with the match() function...dramatically reducing the value of this new conversion function.  That list symptom overlaps with (and is distinct from) this defect where list iteration incorrectly selects item attributes when they are used in operations: https://jira.atlassian.com/browse/AUTO-1674 I recommend a complete round of testing to confirm what does / does not work with the new function and to document the limitations accordingly. Thank you!

            Christopher added a comment -

            The jsonStringToObject() function can be used to transform a String into a JSON object.

            For example use cases and guidance on accessing and manipulating smart values as JSON data in Atlassian Automation Cloud, check out this article.

            https://community.atlassian.com/forums/Automation-articles/Accessing-and-manipulating-smart-values-as-JSON-data-in/ba-p/2964051

            Christopher added a comment - The jsonStringToObject() function can be used to transform a String into a JSON object. For example use cases and guidance on accessing and manipulating smart values as JSON data in Atlassian Automation Cloud, check out this article. https://community.atlassian.com/forums/Automation-articles/Accessing-and-manipulating-smart-values-as-JSON-data-in/ba-p/2964051

            It appears there is now a function to help with JSON parsing, although it does not handle nested arrays.  The function is jsonStringToObject().

            https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/#jsonStringToObject--

            Bill Sheboy added a comment - It appears there is now a function to help with JSON parsing, although it does not handle nested arrays.  The function is jsonStringToObject(). https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/#jsonStringToObject--

            We sometimes need to use REST API calls, even to Jira's API for features that are not supported by regular automation actions.

            In order to process the response of the calls property it would be very helpful to parse JSON.

            Charlie Misonne added a comment - We sometimes need to use REST API calls, even to Jira's API for features that are not supported by regular automation actions. In order to process the response of the calls property it would be very helpful to parse JSON.

            Any updates on this feature pls?

            manoj reddy gajjala added a comment - Any updates on this feature pls?

              89403358cf11 Charlie Gavey
              23a96bf052a9 r
              Votes:
              38 Vote for this issue
              Watchers:
              23 Start watching this issue

                Created:
                Updated:
                Resolved: