Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Test Case step status update via REST

Łukasz February 15, 2018

Hello,

I can update normal fields, like priority, comments, etc, but I cant do that with Test Case steps status. Cay you give me example of JSON for this case?

2 answers

1 accepted

2 votes
Answer accepted
Marcin Żurawiecki
Atlassian Partner
February 21, 2018

Hello Łukasz!

Of course you can update the status of your Test Case using Jira REST API. The thing is, you have to include the whole structure of this custom field and not only the desired cell.

JSON file should look like this:

 {"fields":{
 "customfield_10106": {
            "header": {
                "number": 0,
                "columns": [
                    {
                        "number": 1,
                        "name": "Action",
                        "isStatus": false
                    },
                    {
                        "number": 2,
                        "name": "Data",
                        "isStatus": false
                    },
                    {
                        "number": 3,
                        "name": "Expected Result",
                        "isStatus": false
                    },
                    {
                        "number": 4,
                        "name": "Status",
                        "isStatus": true
                    }
                ]
            },
            "rows": [
                {
                    "number": 1,
                    "columns": [
                        {
                            "number": 1,
                            "value": "Login into application",
                            "groupId": 0,
                            "isStatus": false
                        },
                        {
                            "number": 2,
                            "value": "test",
                            "groupId": 0,
                            "isStatus": false
                        },
                        {
                            "number": 3,
                            "value": "Redirect to dashboard",
                            "groupId": 0,
                            "isStatus": false
                        },
                        {
                            "number": 4,
                            "value": "In Progress",
                            "groupId": 0,
                            "isStatus": true
                        }
                    ]
                },
                {
                    "number": 2,
                    "columns": [
                        {
                            "number": 1,
                            "value": "13",
                            "groupId": 1,
                            "groupName": "GroupA",
                            "isStatus": false
                        },
                        {
                            "number": 2,
                            "value": "4",
                            "groupId": 1,
                            "groupName": "GroupA",
                            "isStatus": false
                        },
                        {
                            "number": 3,
                            "value": "4",
                            "groupId": 1,
                            "groupName": "GroupA",
                            "isStatus": false
                        },
                        {
                            "number": 4,
                            "value": "Passed",
                            "groupId": 1,
                            "isStatus": true
                        }
                    ]
                }
            ]
        }
}}

Hope it helps.

 

Kind regards,

Marcin, TestFLO Team

0 votes
Warren
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 15, 2018

I'm assuming Test Case is part of an add-on?

Generally, if you want to know what format the JSON should be for a particular field, try "getting" all the fields for one issue which has data in the fields that you're interested in. You can then see how the GET looks to know what the POST format should be

Łukasz February 15, 2018

Yes, it's part of TestFLO addon.

Here is exaple of GET: 

https://intenso.atlassian.net/wiki/spaces/FLO/pages/23265630/REST+JSON

The problem is that I dont know how to refer to nested fields ("value"  e.x. in 4th column in 3rd row).

Warren
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 15, 2018

Sorry, I'm more confused now. You want to know what the JSON format should be, but the link that you gave has an example of the format, which in my opinion answers your question.

Is there something more that you want? Could you try to rephrase what you are asking?

Łukasz February 15, 2018

I need to write sth like that:

 

{
"update" : {
"customfield_10107":{"row.2":{"column.4":[{"set": {"value":"Passed"}}]}}
}

}

 

But dont know the syntax to that (second row etc..)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events