Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to change a value in an array at specific index

John May 20, 2015

Hello all,

I am trying to change a value inside an array via the REST-API. The structure is like the following:

"customfield_10807": {
            "rows": [{
                "number": 1,
                "columns": [{
                    "number": 4,
                    "value": "",
                    "groupId": 0,
                    "isStatus": false
                }, {
                    "number": 5,
                    "value": "Open",
                    "groupId": 0,
                    "isStatus": true
                }]
            }, {
                "number": 2,
                "columns": [{
                    "number": 4,
                    "value": "",
                    "groupId": 0,
                    "isStatus": false
                }, {
                    "number": 5,
                    "value": "In Progress",
                    "groupId": 0,
                    "isStatus": true
                }]
            }]

How do I change 

"value": "In Progress"

to:

"value": "Resolved"

 

Is it possible to locate the array element with help of an index? Any help would be greatly appreciated!

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Felipe Kraemer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 25, 2015

Hi John,

As far as I understand, you're trying to update a custom field value. In this case, please have a look at this document. It looks like you can use the editmeta resource to retrieve the fields available for editing. To update, you should use PUT on issue key.

If this answer was helpful, please allow me to ask you to mark my answer as accepted in order to have it in the top of the thread, also helping other customers.

Thanks in advance!

Kind regards,
Felipe Kraemer

TAGS
AUG Leaders

Atlassian Community Events