How to call a JQL query in Python -


i working on script in python call jql script. how go this?

curl -d- -u fred:fred -x -h "content-type: application/json" http://kelpie9:8081/rest/api/2/search?jql=assignee=fred+order+by+duedate 

assume above jql query.

this have far it's getting "invalid syntax" error.

from grt import executescript  querystring = "curl -d- -u fred:fred -x -h "content-type: application/json"      http://kelpie9:8081/rest/api/2/search?jql=project=qa+order+by+duedate&fields=id,key" executescript(querystring) 

this error:

      file "/home/.spyder2/temp.py", line 19     querystring = "curl -d- -u fred:fred -x -h "content-type: application/json"      http://kelpie9:8081/rest/api/2/search?jql=project=qa+order+by+duedate&fields=id,key"                                                       ^ syntaxerror: invalid syntax 

you don't open/close string properly:

querystring = "curl -d- -u fred:fred -x -h "content-type: application/json"      http://kelpie9:8081/rest/api/2/search?jql=project=qa+order+by+duedate&fields=id,key" 

should be:

querystring = """curl -d- -u fred:fred -x -h "content-type: application/json" http://kelpie9:8081/rest/api/2/search?jql=project=qa+order+by+duedate&fields=id,key""" 

because string contains double-quotes.


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -