Unable to create change task using sn_chg_rest API

Ram118
Mega Guru

Hi there!

I am trying to create the Change Task using API. I am getting the below error message, but I am not sure what it is causing this issue.

Payload:

{
  "type": "planning",
  "short-description": "test",
  "description": "desc",
  "state": "-5"
}

Error Message:

{

    "error": {
        "message": "Change Task found, but not related to Change Request: <CR_sys_id>",
        "detail": ""
    },
    "status": "failure"
}
1 ACCEPTED SOLUTION

Ram118
Mega Guru

@rsram312  Yes, we found the issue.  In the ACL's there is a condition as "Active = true".  
As a normal ITIL user, when you submit a request to create the Change Req. or Change Task. This "Active = true" field value is not setting automatically. 

 

Solution Proposed:  

1. Adjust your ACL's to bypass this condition based on Active field. 

OR 

2.  Add "active: true" in the request Payload whenever you send the request.

View solution in original post

7 REPLIES 7

Ram118
Mega Guru

@rsram312  Yes, we found the issue.  In the ACL's there is a condition as "Active = true".  
As a normal ITIL user, when you submit a request to create the Change Req. or Change Task. This "Active = true" field value is not setting automatically. 

 

Solution Proposed:  

1. Adjust your ACL's to bypass this condition based on Active field. 

OR 

2.  Add "active: true" in the request Payload whenever you send the request.

rsram312
Tera Contributor

@Ram118  Thanks for the response. 

This is the request I was trying

curl -X POST -H "Content-Type: application/json" \
-H "Accept:application/json" \
-u "<username>:<password>" \
-d '{"active":true, "short_description":"<short-description>","description":"<description>","assignment_group":"<assignment-group>"}' \
"https://<instance>/api/sn_chg_rest/change/<task-id>/task?active=true"

I tried passing active=true both as query parameter and the payload. I still am seeing the same error - 

{"error":{"message":"Change Task found, but not related to Change Request: <task-id>","detail":""},"status":"failure"}%

Anything else we had to change?

 

@rsram312  

First check if there are any data policies that are blocking this. If so, then deactivate them. 

No need to pass the active =true in query parameters. Inside payload is enough. 

 

Still if you are facing the issue, try de-activating the create ACL's on Change Task table level. 

Note: Ensure you are taking backup or capturing the changes in the Updateset. Just to be on safe side.