i have to change the status in jira but i unable to update using jira fields so i searched on net about how to chnage status using api call.
so found below document which is having curl commands
and i dont have any idea how to use that in uipath .
please explain how to use this so ican try.
First you need to get information about the issue and find out what possible transitions are available, then you have to make the transitions one by one according to the available hierarchy - just like a human does.
Try to invoke C# code (I don’t know is it suitable).
This is cUrl to C# code using RestSharp library (You can download it from the Package Manager in UiPath. NuGet link for preview: NuGet Gallery | RestSharp 110.2.0)
var client = new RestSharp.RestClient("http://jira/rest/api/2/issue/TEST-1/transitions");
client.Timeout = -1;
var request = new RestSharp.RestRequest(Method.POST);
var base64authorization = Convert.ToBase64String(Encoding.ASCII.GetBytes(username +":"+password));
request.AddHeader("Authorization", $"Basic {base64authorization}"); // or ("Authorization", String.Format("Basic {0}",base64authorization))
request.AddHeader("Content-Type", "application/json");
request.AddJsonBody("{""transition"":{""id"":""11""}}");
response = client.Execute(request);
An easy way to look at an ID transition is: hover your mouse over the transition (action) button and see what number is next to the action in the bar at the bottom of the browser.
Then you just need to find this transition ID after geting the Issue details by Jira GET Issue.
i have my username and password with me for jira.
but dont know where to update in postman with respect to ur code and i have token generated by pistman.
kindly suggest if i have put wrong values , and what need to be change
Additional in Arguments:
ProjectKey As String = eg.: “ABC-1234”
'Create a new HTTP request
Dim client As HttpClient = New HttpClient()
'Specify the target address
client.BaseAddress = New Uri(uri) 'argument IN
'Clear header for new iteration
client.DefaultRequestHeaders.Accept.Clear()
'Enter new header parameters
client.DefaultRequestHeaders.Accept.Add( New MediaTypeWithQualityHeaderValue( "application/json" ))
client.DefaultRequestHeaders.Authorization = New AuthenticationHeaderValue(“Basic”, token)
'Create query parameters
Dim request As HttpRequestMessage = New HttpRequestMessage (HttpMethod.Get, ("rest/api/2/issue/" +ProjectKey+ "/transitions" ) '(Method type, relative access path)
'No Body of the query
'Indicate the service from which to reply to the inquiry
response = client.SendAsync(request).Result
Next:
Deserialize JSON from response.Content.ReadAsStringAsync.Result to Response_JsonObject
Next:
Build Data Table with 1 column ( ID As Int32)
For each transition in Response_JsonObject("transitions")
Assign: id = transition.Item("id").ToString
Add id to Data Row
Next:
Sort ascending Data Table
Next:
I have used swith activity and when I have specific ID’s then I set new status_ID:
Then:
Post New Transition Jira Do Issue Transition:
'Create a new HTTP request
Dim client As HttpClient = New HttpClient()
'Specify the target address
client.BaseAddress = New Uri(uri) 'argument IN
'Clear header for new iteration
client.DefaultRequestHeaders.Accept.Clear()
'Enter new header parameters
client.DefaultRequestHeaders.Accept.Add( New MediaTypeWithQualityHeaderValue( "application/json" ))
client.DefaultRequestHeaders.Authorization = New AuthenticationHeaderValue(“Basic”, token)
'Create query parameters
Dim request As HttpRequestMessage = New HttpRequestMessage (HttpMethod.Post, ("rest/api/2/issue/" +ProjectKey+ "/transitions" ) '(Method type, relative access path)
'Body of the query
request.Content = New StringContent(JsonString, System.Text.Encoding.UTF8, "application/json" )
'Indicate the service from which to reply to the inquiry
response = client.SendAsync(request).Result