Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

CURL post for graphql mutation

KrishnaMohan June 8, 2023

Hello Community,

I can add related work items in the Jira release version using https://developer.atlassian.com/cloud/compass/graphql/explorer/.  

Now I want to automate the same using the curl post command. I tried all the ways but it is throwing an error.

* We are completely uploaded and fine

* HTTP/2 stream 1 was not closed cleanly before end of the underlying stream

* Closing connection 0

curl: (18) HTTP/2 stream 1 was not closed cleanly before end of the underlying stream

Here is the code I tried using curl. 

curl https://devopsdemo.atlassian.net/gateway/api/graphql -v --http2 --request POST \

-H "X-Experimentalapi: AddRelatedWorkToVersion"\

-H "Content-Type : application/json"\

-d "$(jq -c -n --arg query '

{

mutation useAddGenericLinkRelatedWork_addRelatedWorkMutation {

jira {

addRelatedWorkToVersion(

input: {

versionId: "ari:cloud:jira:<versionid>:version/activation/<key>/10000",

relatedWorkId: "234", url: "https://www.w3.org/Addressing/URL/url-spec.txt",

title: "Reports",

category: "Testing"})

}

{

success

errors

{

message

}

}

}

}"' '{"query":$query}')"

 
Any suggestions?

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events