Option to update "Resolution" field in Jira issue using JiraPS powershell module

Sagar_kvs May 27, 2020

I am looking for an option to update the "Resolution" filed in jira issue using powershell  cmdlet.

 

We are auto closing the jira issues using Set-JiraIssue and Invoke-JiraIssueTransition comdlets. when we do this the resolution field is setting to unresolved, so tried passing the Resolution values in fields parameter, as the function not validating this field it is throwing an error.

 

further tried passing it to Invoke-JiraMethod throws below error. do we have an option to update the resolution field.

 

$headers = @{
self = "https://$($jiraserver)/rest/api/2/resolution/10202"
id = 10202
description = 'The issue has been resolved'
name = 'Resolved'
}


$body = $headers | ConvertTo-Json -Depth 3
$URL = "https://$($jiraserver)/rest/api/latest/issue/1232324"
Invoke-JiraMethod -URI $URL -Method Post -Credential $creds -Body $body -Verbose

capture.PNG

 

2 answers

1 vote
Thomas Burke November 16, 2022

Dont understand ,  so you can or cannot  use JIRAPS module to update *resoultion* field?

0 votes
C_ Derek Fields
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 27, 2020

You can't update the Resolution field directly. You need to create a post-function in the transition that will update the Resolution field when you invoke the transition.

If you have issues that are "Closed" but have Resolution = Empty, you need to create a new transition from Closed to Closed that will set the resolution field to a value. You can then invoke the transition either from a bulk update or from your PowerShell script to set the resolution.

Sagar_kvs May 27, 2020

So the resolution field should have some default values that comes part of post function at the time of creating an issue, only then we can do transition of values in resolution field. Am I correct?

 

And this post function should be created by jira administrators?

C_ Derek Fields
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 27, 2020

The list of available Resolution values is set by the Jira Administrator. When the issue is originally created, the Resolution field will be empty. The Jira Administrator will have to update the workflow to add the post-function to the transition that would set the Resolution.

Sagar_kvs May 28, 2020

Thanks Derek, will check with my jira administrator on the possibilities of post function on resolution field.

Sagar_kvs May 28, 2020

I am trying to filter tickets based on resolution but cannot filter tickets.

 

When downloading the excel I am not seeing the resolution field.

Am I looking at wrong fields?

Suggest an answer

Log in or Sign up to answer