Hi there,
I would like to connect with Powershell to our Jira Cloud environment.
Authentication by using a Token instead of username and password.
So thought that shouldn't be difficult
One of the syntax I tried was:
$Headers = @{
Authorization = 'Bearer'
Token = $token
}
Invoke-WebRequest -Uri 'https://transdev-nl.atlassian.net/rest/api/2/search?jql=project = CIT AND issuetype = "JIRA Request" AND (created >= startOfDay(-30d) OR updated >= startOfDay(-30d))' -Headers $Headers
But the system sas no! :)
or
Invoke-WebRequest : The remote server returned an error: (400) Bad Request.
At line:7 char:1
+ Invoke-WebRequest -Uri 'https://transdev-nl.atlassian.net/rest/api/2/ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebException
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
Guys can someone help me with getting the correct syntax to make this work.
Kind regards,
Murat
Can you have a look at the discussion here ? Seems like you would need to have 2FA enabled. Also https://atlassianps.org/ seems to be a great way to get started 😃
Cheers
Ajay
Thanks Ajay
That was usefull information. Login part is working.
Now I have to learn more about how to write query's to get the needed information out of jira.
Thanks again and take care of your self.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.