Automic Continuous Delivery Automation

Expand all | Collapse all

ATTACH_FILE_TO_CHANGE_REQUEST - SERVICE NOW Action Pack not working

  • 1.  ATTACH_FILE_TO_CHANGE_REQUEST - SERVICE NOW Action Pack not working

    Posted 03-29-2018 12:15 AM

    I have downloaded the action pack from the market place -https://marketplace.automic.com/details/servicenow-action-pack

    I'm trying to attach the file to the Service Now change request which was created.. I tried executing the action PCK.CUSTOM_SERVICENOW.PUB.ACTION.ATTACH_FILE_TO_CHANGE_REQUEST which was downloaded from the market place with the below settings
    I have tried various options , but none of them seem to work. Can you suggest how to get this working ?

    1) Request Settings
         --> Use Multipart Request
    2) Media Type - text/plain

    I get the below error when I run the action Pack

    2018-03-27 07:24:38             Connect timeout set to 30 seconds
    2018-03-27 07:24:38             Read timeout set to:60
    2018-03-27 07:24:38             setting http proxy: host: ##########
    2018-03-27 07:24:38             Using connection: Created from prompts
    2018-03-27 07:24:38             Authentication type:Basic
    2018-03-27 07:24:38             Request:POST https://nomuratest.service-now.com/api/now/attachment/upload?table_name=change_request&table_sys_id=9a668828db0cd700cd66b6bffe9619b4&file_name=ARA-778_TestEvidence.txt
    2018-03-27 07:24:38             Request headers:[]
    2018-03-27 07:24:38             Request:
    2018-03-27 07:24:38                  Media type:text/plain
    2018-03-27 07:24:38                  Request file:D:\Temp\ARA-778_TestEvidence.txt
    2018-03-27 07:24:38             Sending request...
    2018-03-27 07:24:39             Response:
    2018-03-27 07:24:39             Status:415 Unsupported Media Type
    2018-03-27 07:24:39             Response headers:[Set-Cookie:[JSESSIONID=5EE73D6895883CEF31640458557235AF; Path=/; HttpOnly;Secure, BIGipServerpool_nomuratest=679532042.56638.0000; path=/; Httponly; Secure], Pragma:[no-store,no-cache], Cache-control:[no-cache,no-store,must-revalidate,max-age=-1], Expires:[0], Content-Type:[application/json;charset=UTF-8], Transfer-Encoding:[chunked], Date:[Tue, 27 Mar 2018 06:24:39 GMT], Server:[ServiceNow], Strict-Transport-Security:[max-age=63072000; includeSubDomains]]
    2018-03-27 07:24:39            
    2018-03-27 07:24:39            
    2018-03-27 07:24:39             An error occured - after the request
    2018-03-27 07:24:39             Response error code: 415 (Response family:CLIENT_ERROR), Exception: {"error":{"detail":null,"message":"Invalid content-type. Supported request media types for this service are: [multipart/form-data]"},"status":"failure"}:Unsupported Media Type

    ***************************************************************************************************************************************
    1) Request Settings
         --> Use Multiplart Request
    2) Media Type - application/json

    I get the below error when I run the action Pack

    2018-03-27 07:31:01             Connect timeout set to 30 seconds
    2018-03-27 07:31:01             Read timeout set to:60
    2018-03-27 07:31:01             setting http proxy: ##########
    2018-03-27 07:31:01             Using connection: Created from prompts
    2018-03-27 07:31:01             Authentication type:Basic
    2018-03-27 07:31:01             Request:POST https://nomuratest.service-now.com/api/now/attachment/upload?table_name=change_request&table_sys_id=9a668828db0cd700cd66b6bffe9619b4&file_name=ARA-778_TestEvidence.txt
    2018-03-27 07:31:01             Request headers:[]
    2018-03-27 07:31:01             Request:
    2018-03-27 07:31:01                  Media type:application/json
    2018-03-27 07:31:01                  Request file:D:\Temp\ARA-778_TestEvidence.txt
    2018-03-27 07:31:01             Sending request...
    2018-03-27 07:31:02             Response:
    2018-03-27 07:31:02             Status:415 Unsupported Media Type
    2018-03-27 07:31:02             Response headers:[Set-Cookie:[JSESSIONID=8D1283178E6DE9F966E30104E344F364; Path=/; HttpOnly;Secure, BIGipServerpool_nomuratest=645977610.38718.0000; path=/; Httponly; Secure], Pragma:[no-store,no-cache], Cache-control:[no-cache,no-store,must-revalidate,max-age=-1], Expires:[0], Content-Type:[application/json;charset=UTF-8], Transfer-Encoding:[chunked], Date:[Tue, 27 Mar 2018 06:31:01 GMT], Server:[ServiceNow], Strict-Transport-Security:[max-age=63072000; includeSubDomains]]
    2018-03-27 07:31:02            
    2018-03-27 07:31:02            
    2018-03-27 07:31:02             An error occured - after the request
    2018-03-27 07:31:02             Response error code: 415 (Response family:CLIENT_ERROR), Exception: {"error":{"detail":null,"message":"Invalid content-type. Supported request media types for this service are: [multipart/form-data]"},"status":"failure"}:Unsupported Media Type

    ********************************************************************************************************
    1) Request Settings
         --> Use Multiplart Request
    2) Media Type - application/octet-stream

    2018-03-27 07:32:39             Connect timeout set to 30 seconds
    2018-03-27 07:32:39             Read timeout set to:60
    2018-03-27 07:32:39             setting http proxy: ##########
    2018-03-27 07:32:39             Using connection: Created from prompts
    2018-03-27 07:32:39             Authentication type:Basic
    2018-03-27 07:32:39             Request:POST https://nomuratest.service-now.com/api/now/attachment/upload?table_name=change_request&table_sys_id=9a668828db0cd700cd66b6bffe9619b4&file_name=ARA-778_TestEvidence.txt
    2018-03-27 07:32:39             Request headers:[]
    2018-03-27 07:32:39             Request:
    2018-03-27 07:32:39                  Media type:application/octet-stream
    2018-03-27 07:32:39                  Request file:D:\Temp\ARA-778_TestEvidence.txt
    2018-03-27 07:32:39             Sending request...
    2018-03-27 07:32:39             Response:
    2018-03-27 07:32:39             Status:415 Unsupported Media Type
    2018-03-27 07:32:39             Response headers:[Set-Cookie:[JSESSIONID=9E15006B1F13ECFCA1E077B3238385CB; Path=/; HttpOnly;Secure, BIGipServerpool_nomuratest=679532042.56638.0000; path=/; Httponly; Secure], Pragma:[no-store,no-cache], Cache-control:[no-cache,no-store,must-revalidate,max-age=-1], Expires:[0], Content-Type:[application/json;charset=UTF-8], Transfer-Encoding:[chunked], Date:[Tue, 27 Mar 2018 06:32:39 GMT], Server:[ServiceNow], Strict-Transport-Security:[max-age=63072000; includeSubDomains]]
    2018-03-27 07:32:39            
    2018-03-27 07:32:39            
    2018-03-27 07:32:39             An error occured - after the request
    2018-03-27 07:32:39             Response error code: 415 (Response family:CLIENT_ERROR), Exception: {"error":{"detail":null,"message":"Invalid content-type. Supported request media types for this service are: [multipart/form-data]"},"status":"failure"}:Unsupported Media Type

    I get the same error even if I run the action pack without selecting the "Use Multipart Request" option in the Request settings.

    How can I make this working ? Any inputs would be highly appreciated.



  • 2.  ATTACH_FILE_TO_CHANGE_REQUEST - SERVICE NOW Action Pack not working

    Posted 03-29-2018 04:40 AM
    Hello Rethish Radhakrishnan 

    I tried the link for service now, in our instance It look like  we got a respond, it looked like Get method not supported for API
    <response>
    <error>
    <detail>GET method not supported for API</detail>
    <message>Method not Supported</message>
    </error>
    <status>failure</status>
    </response>
    j1rw4ch02u32.pnghttps://us.v-cdn.net/5019921/uploads/editor/i7/j1rw4ch02u32.png" width="1164">

    you may try difference method 


  • 3.  ATTACH_FILE_TO_CHANGE_REQUEST - SERVICE NOW Action Pack not working

    Posted 04-02-2018 02:09 AM
    Hi Tran-Hoang Hau ,
    Correct. There are quite a few methods which are not supported via the action pack. The service now api works without any issues at my end.
    For eg : The "ATTACH FILE TO CHANGE REQUEST"  action pack is not working. Have you tried running this action pack ?

    All,
    Has any one from the community tried executing the above action pack ? Is it working?




  • 4.  ATTACH_FILE_TO_CHANGE_REQUEST - SERVICE NOW Action Pack not working

    Posted 04-02-2018 06:20 AM
    Hi Rethish Radhakrishnan ,

    According to service now code 
    415
    The endpoint does not support the format of the request body.

    https://developer.servicenow.com/app.do#!/rest_api_doc?v=jakarta&id=r_AttachmentAPI-POSTmultipart
    I would suggest you to modify the job directly from the request to see if it work
    lrbsfyfe4cci.pnghttps://us.v-cdn.net/5019921/uploads/editor/ds/lrbsfyfe4cci.png" width="1459"> 




  • 5.  Re: ATTACH_FILE_TO_CHANGE_REQUEST - SERVICE NOW Action Pack not working

    Posted 07-24-2018 05:11 AM

    Hi Rethish,

     

    You shouldn't need to modify anything within the job definitions. By default, within the Request tab for both ATTACH_FILE_TO_CHANGE_REQUEST and ATTACH_FILE_TO_CHANGE_TASK,  Use Multi-Part Request should be unticked i.e. "single-part response" and Media Type set to application/octet-stream. I've just downloaded 1.0.3 of the Action pack and successfully created a change request, a change task and added attachments to both.

     

     

    Regards

    Tim