指派一条或多条变更

指派一条或多条变更

API调用URL地址

http://<serverName>:<portNumber>/api/v3/changes/assign?ids={change_ids}

其中{change_ids}为需要指派的请求ID,多个使用逗号隔开

示例:http://192.168.0.163:8080/api/v3/changes/assign?ids=3,5

请求参数

方法:PUT

请求参数:

参数名

位置

input_data

<JSON_String>

body

authtoken

<API Key>

header

 

输入示例

 {

    "change":{
        "change_owner":{
            "id":"5"
        }

    }

}

注:将所选的变更指派给id为5的用户。

响应示例

 {

    "response_status":[
        {
            "status_code":2000,
            "id":"3",
            "status":"success"
        }
,
        {
            "status_code":2000,
            "id":"5",
            "status":"success"
        }

    ]
,
    "changes":[
        {
            "template":{
                "name":"General Template",
                "id":"1"
            }
,
            "short_description":null,
            "attachments":[

            ]
,
            "roll_out_plan":{
                "updated_on":{
                    "display_value":"22/11/2021 02:44 PM",
                    "value":"1637563444660"
                }
,
                "internal_name":"roll_out_plan",
                "attachments":[

                ]
,
                "stage":{
                    "internal_name":"Planning",
                    "stage_index":"2",
                    "name":"Planning",
                    "id":"2"
                }
,
                "change":{
                    "id":"3"
                }
,
                "name":"roll_out_plan",
                "updated_by":{
                    "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
                }
,
                "description":"test",
                "id":"301"
            }
,
            "closure_code":null,
            "sla_violation":null,
            "roles":[

            ]
,
            "description":null,
            "emergency":false,
            "change_type":null,
            "title":"test3",
            "review_details":{
                "updated_on":{
                    "display_value":"22/11/2021 02:44 PM",
                    "value":"1637563444691"
                }
,
                "internal_name":"review_details",
                "attachments":[

                ]
,
                "stage":{
                    "internal_name":"Review",
                    "stage_index":"5",
                    "name":"Review",
                    "id":"5"
                }
,
                "change":{
                    "id":"3"
                }
,
                "name":"review_details",
                "updated_by":{
                    "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
                }
,
                "description":"test",
                "id":"305"
            }
,
            "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":null,
            "assets":[

            ]
,
            "urgency":null,
            "close_details":{
                "updated_on":{
                    "display_value":"22/11/2021 02:44 PM",
                    "value":"1637563444706"
                }
,
                "internal_name":"close_details",
                "attachments":[

                ]
,
                "stage":{
                    "internal_name":"Close",
                    "stage_index":"6",
                    "name":"Close",
                    "id":"6"
                }
,
                "change":{
                    "id":"3"
                }
,
                "name":"close_details",
                "updated_by":{
                    "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
                }
,
                "description":"test",
                "id":"306"
            }
,
            "id":"3",
            "change_requester":null,
            "group":null,
            "created_time":{
                "display_value":"22/11/2021 10:35 AM",
                "value":"1637548529656"
            }
,
            "item":null,
            "workflow":{
                "validated":true,
                "name":"SDGeneral",
                "id":"1",
                "type":"General"
            }
,
            "approval_status":{
                "name":"Pending Approval",
                "id":"1"
            }
,
            "change_manager":null,
            "impact":null,
            "retrospective":false,
            "sla":null,
            "checklist":{
                "updated_on":{
                    "display_value":"22/11/2021 02:44 PM",
                    "value":"1637563444675"
                }
,
                "internal_name":"checklist",
                "attachments":[

                ]
,
                "stage":{
                    "internal_name":"Planning",
                    "stage_index":"2",
                    "name":"Planning",
                    "id":"2"
                }
,
                "change":{
                    "id":"3"
                }
,
                "name":"checklist",
                "updated_by":{
                    "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
                }
,
                "description":"test",
                "id":"303"
            }
,
            "services":[

            ]
,
            "priority":null,
            "scheduled_end_time":null,
            "back_out_plan":{
                "updated_on":{
                    "display_value":"22/11/2021 02:44 PM",
                    "value":"1637563444691"
                }
,
                "internal_name":"back_out_plan",
                "attachments":[

                ]
,
                "stage":{
                    "internal_name":"Planning",
                    "stage_index":"2",
                    "name":"Planning",
                    "id":"2"
                }
,
                "change":{
                    "id":"3"
                }
,
                "name":"back_out_plan",
                "updated_by":{
                    "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
                }
,
                "description":"test",
                "id":"304"
            }
,
            "site":null,
            "stage":{
                "internal_name":"Submission",
                "stage_index":"1",
                "name":"Submission",
                "id":"1"
            }
,
            "reason_for_change":null,
            "completed_time":null,
            "risk":null,
            "impact_details":{
                "updated_on":{
                    "display_value":"22/11/2021 02:44 PM",
                    "value":"1637563444675"
                }
,
                "internal_name":"impact_details",
                "attachments":[

                ]
,
                "stage":{
                    "internal_name":"Planning",
                    "stage_index":"2",
                    "name":"Planning",
                    "id":"2"
                }
,
                "change":{
                    "id":"3"
                }
,
                "name":"impact_details",
                "updated_by":{
                    "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
                }
,
                "description":"test",
                "id":"302"
            }
,
            "category":null,
            "subcategory":null,
            "notes_present":false,
            "status":{
                "internal_name":"Requested",
                "prominent":false,
                "stage":{
                    "id":"1"
                }
,
                "action_name":null,
                "name":"Requested",
                "id":"3"
            }
,
            "scheduled_start_time":null
        }
,
        {
            "template":{
                "name":"General Template",
                "id":"1"
            }
,
            "short_description":"description",
            "attachments":[

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

                ]
,
                "stage":{
                    "internal_name":"Planning",
                    "stage_index":"2",
                    "name":"Planning",
                    "id":"2"
                }
,
                "change":{
                    "id":"5"
                }
,
                "name":"roll_out_plan",
                "updated_by":null,
                "description":null,
                "id":"314"
            }
,
            "closure_code":null,
            "sla_violation":null,
            "roles":[
                {
                    "role":{
                        "name":"Implementer",
                        "id":"8"
                    }
,
                    "change":{
                        "short_description":"description",
                        "id":"5",
                        "title":"WAN - Port - Reconfigure"
                    }
,
                    "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"
                    }
,
                    "change":{
                        "short_description":"description",
                        "id":"5",
                        "title":"WAN - Port - Reconfigure"
                    }
,
                    "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,
                "internal_name":"review_details",
                "attachments":[

                ]
,
                "stage":{
                    "internal_name":"Review",
                    "stage_index":"5",
                    "name":"Review",
                    "id":"5"
                }
,
                "change":{
                    "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,
                "internal_name":"close_details",
                "attachments":[

                ]
,
                "stage":{
                    "internal_name":"Close",
                    "stage_index":"6",
                    "name":"Close",
                    "id":"6"
                }
,
                "change":{
                    "id":"5"
                }
,
                "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,
                "internal_name":"checklist",
                "attachments":[

                ]
,
                "stage":{
                    "internal_name":"Planning",
                    "stage_index":"2",
                    "name":"Planning",
                    "id":"2"
                }
,
                "change":{
                    "id":"5"
                }
,
                "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,
                "internal_name":"back_out_plan",
                "attachments":[

                ]
,
                "stage":{
                    "internal_name":"Planning",
                    "stage_index":"2",
                    "name":"Planning",
                    "id":"2"
                }
,
                "change":{
                    "id":"5"
                }
,
                "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,
                "internal_name":"impact_details",
                "attachments":[

                ]
,
                "stage":{
                    "internal_name":"Planning",
                    "stage_index":"2",
                    "name":"Planning",
                    "id":"2"
                }
,
                "change":{
                    "id":"5"
                }
,
                "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
 
url = "http://192.168.0.163:8080/api/v3/changes/assign?ids=3,5"
headers = {"authtoken":"2D02FD93-9BD8-484E-ADEF-727FA69A161B"}
input_data = '''{
    "change": {
        "change_owner": {
            "id": "5"
        }
    }
}'''
data = {'input_data': input_data}
response = requests.put(url,headers=headers,data=data,verify=False)
print(response.text)