修改一条变更

修改一条变更

API调用URL地址

http://<serverName>:<portNumber>/api/v3//changes/{change_id}

其中{change_id}为需要修改的变更ID

示例:http://192.168.0.163:8080/api/v3/changes/5

请求参数

方法:PUT

请求参数:

参数名

位置

input_data

<JSON_String>

body

authtoken

<API Key>

header

 

输入示例

{
    "change":{
        "title":"WAN - Port - Reconfigure",
        "roles":[
            {
                "role":{
                    "id":"8"
                }
,
                "id":"1",
                "user":{
                    "id":"5"
                }

            }
,
            {
                "role":{
                    "id":"8"
                }
,
                "id":"2",
                "user":{
                    "id":"7"
                }

            }

        ]
,
        "change_requester":{
            "id":"4"
        }
,
        "change_manager":{
            "id":"5"
        }
,
        "back_out_plan":{
            "description":"test",
            "id":"301"
        }
,
        "roll_out_plan":{
            "description":"test",
            "id":"302"
        }
,
        "impact_details":{
            "description":"test",
            "id":"303"
        }
,
        "checklist":{
            "description":"test",
            "id":"304"
        }
,
        "review_details":{
            "description":"test",
            "id":"305"
        }
,
        "close_details":{
            "description":"test",
            "id":"306"
        }

    }

} 

响应示例

 {

    "response_status":{
        "status_code":2000,
        "status":"success"
    }
,
    "change":{
        "template":{
            "name":"General Template",
            "id":"1"
        }
,
        "short_description":"description",
        "attachments":[

        ]
,
        "roll_out_plan":{
            "updated_on":null,
            "attachments":[

            ]
,
            "stage":{
                "internal_name":"Planning",
                "stage_index":"2",
                "name":"Planning",
                "id":"2"
            }
,
            "name":"roll_out_plan",
            "updated_by":null,
            "description":null,
            "id":"314"
        }
,
        "closure_code":null,
        "sla_violation":null,
        "roles":[
            {
                "role":{
                    "name":"Implementer",
                    "id":"8"
                }
,
                "id":"1",
                "user":{
                    "email_id":null,
                    "phone":"1234455",
                    "name":"administrator",
                    "mobile":"1234567890",
                    "profile_pic":{
                        "content-url":"/images/default-profile-pic2.svg",
                        "name":"default-profile-pic2.svg"
                    }
,
                    "is_vipuser":false,
                    "id":"5",
                    "department":null
                }
,
                "label_id":null,
                "group":null
            }
,
            {
                "role":{
                    "name":"Implementer",
                    "id":"8"
                }
,
                "id":"2",
                "user":{
                    "email_id":null,
                    "phone":"925-852-2602",
                    "name":"Heather Graham",
                    "mobile":"",
                    "profile_pic":{
                        "content-url":"/images/default-profile-pic2.svg",
                        "name":"default-profile-pic2.svg"
                    }
,
                    "is_vipuser":false,
                    "id":"7",
                    "department":null
                }
,
                "label_id":null,
                "group":null
            }

        ]
,
        "description":"description",
        "emergency":false,
        "change_type":{
            "color":"#ff6666",
            "pre_approved":false,
            "name":"Major",
            "id":"2"
        }
,
        "title":"WAN - Port - Reconfigure",
        "review_details":{
            "updated_on":null,
            "attachments":[

            ]
,
            "stage":{
                "internal_name":"Review",
                "stage_index":"5",
                "name":"Review",
                "id":"5"
            }
,
            "name":"review_details",
            "updated_by":null,
            "description":null,
            "id":"317"
        }
,
        "change_owner":{
            "email_id":null,
            "phone":"1234455",
            "name":"administrator",
            "mobile":"1234567890",
            "profile_pic":{
                "content-url":"/images/default-profile-pic2.svg",
                "name":"default-profile-pic2.svg"
            }
,
            "is_vipuser":false,
            "id":"5",
            "department":null
        }
,
        "next_review_on":{
            "display_value":"19/12/2022 03:33 AM",
            "value":"1671392007925"
        }
,
        "assets":[

        ]
,
        "urgency":{
            "name":"Normal",
            "id":"3"
        }
,
        "close_details":{
            "updated_on":null,
            "attachments":[

            ]
,
            "stage":{
                "internal_name":"Close",
                "stage_index":"6",
                "name":"Close",
                "id":"6"
            }
,
            "name":"close_details",
            "updated_by":null,
            "description":null,
            "id":"318"
        }
,
        "id":"5",
        "change_requester":{
            "email_id":"test1@test.com",
            "phone":"8888",
            "name":"Guest",
            "mobile":"1234567890",
            "profile_pic":{
                "content-url":"/images/default-profile-pic2.svg",
                "name":"default-profile-pic2.svg"
            }
,
            "is_vipuser":false,
            "id":"4",
            "department":null
        }
,
        "group":null,
        "created_time":{
            "display_value":"22/11/2021 10:58 AM",
            "value":"1637549918266"
        }
,
        "item":{
            "name":"Install",
            "id":"8"
        }
,
        "workflow":{
            "validated":true,
            "name":"SDGeneral",
            "id":"1",
            "type":"General"
        }
,
        "approval_status":{
            "name":"Pending Approval",
            "id":"1"
        }
,
        "change_manager":{
            "email_id":null,
            "phone":"1234455",
            "name":"administrator",
            "mobile":"1234567890",
            "profile_pic":{
                "content-url":"/images/default-profile-pic2.svg",
                "name":"default-profile-pic2.svg"
            }
,
            "is_vipuser":false,
            "id":"5",
            "department":null
        }
,
        "impact":{
            "name":"Low",
            "id":"3"
        }
,
        "retrospective":false,
        "sla":null,
        "checklist":{
            "updated_on":null,
            "attachments":[

            ]
,
            "stage":{
                "internal_name":"Planning",
                "stage_index":"2",
                "name":"Planning",
                "id":"2"
            }
,
            "name":"checklist",
            "updated_by":null,
            "description":null,
            "id":"316"
        }
,
        "services":[
            {
                "name":"Application Login",
                "id":"1"
            }

        ]
,
        "priority":{
            "color":"#ff0000",
            "name":"High",
            "id":"4"
        }
,
        "scheduled_end_time":{
            "display_value":"24/02/2017 02:29 AM",
            "value":"1487874599999"
        }
,
        "back_out_plan":{
            "updated_on":null,
            "attachments":[

            ]
,
            "stage":{
                "internal_name":"Planning",
                "stage_index":"2",
                "name":"Planning",
                "id":"2"
            }
,
            "name":"back_out_plan",
            "updated_by":null,
            "description":null,
            "id":"313"
        }
,
        "site":null,
        "stage":{
            "internal_name":"Submission",
            "stage_index":"1",
            "name":"Submission",
            "id":"1"
        }
,
        "reason_for_change":{
            "name":"Security compliance",
            "id":"2"
        }
,
        "completed_time":null,
        "risk":{
            "name":"High",
            "id":"3"
        }
,
        "impact_details":{
            "updated_on":null,
            "attachments":[

            ]
,
            "stage":{
                "internal_name":"Planning",
                "stage_index":"2",
                "name":"Planning",
                "id":"2"
            }
,
            "name":"impact_details",
            "updated_by":null,
            "description":null,
            "id":"315"
        }
,
        "category":{
            "name":"Software",
            "id":"3"
        }
,
        "subcategory":{
            "name":"Adobe Reader",
            "id":"8"
        }
,
        "notes_present":false,
        "status":{
            "internal_name":"Requested",
            "prominent":false,
            "stage":{
                "id":"1"
            }
,
            "action_name":null,
            "name":"Requested",
            "id":"3"
        }
,
        "scheduled_start_time":{
            "display_value":"16/02/2017 02:30 AM",
            "value":"1487183400000"
        }

    }

}

Postman示例

 

Python脚本示例

#Python version - 3.9
#需要安装requests模块
import requests
 
headers = {"authtoken":"2D02FD93-9BD8-484E-ADEF-727FA69A161B"}
input_data = '''{
    "change": {
        "title": "WAN - Port - Reconfigure",
        "roles": [
            {
                "role": {
                    "id": "8"
                },
                "id": "1",
                "user": {
                    "id": "5"
                }
            },
            {
                "role": {
                    "id": "8"
                },
                "id": "2",
                "user": {
                    "id": "7"
                }
            }
        ],
        "change_requester": {
            "id": "4"
        },
        "change_manager": {
            "id": "5"
        },
        "back_out_plan": {
            "description": "test",
            "id": "301"
        },
        "roll_out_plan": {
            "description": "test",
            "id": "302"
        },
        "impact_details": {
            "description": "test",
            "id": "303"
        },
        "checklist": {
            "description": "test",
            "id": "304"
        },
        "review_details": {
            "description": "test",
            "id": "305"
        },
        "close_details": {
            "description": "test",
            "id": "306"
        }
    }
}'''
data = {'input_data': input_data}
response = requests.put(url,headers=headers,data=data,verify=False)
print(response.text)