Bulk resolve issues with SIL Power Scripts

Daniel Völker February 25, 2019

I'm trying to resolve erroneous issues from broken Workflows via SIL Scripts.

I tried the following:

string issueKey = "ISSUE-193";
%issueKey%.resolutionID = 1;
%issueKey%.resolutionDate = currentDate();

 Unfortunately, it doesn't update the resolutionDate. Any ideas on the correct format for the resolutionDate and how to set it in SIL?

2 answers

1 accepted

0 votes
Answer accepted
Alexey Matveev
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.
February 25, 2019

Hello,

The resolutionDate field is a read-only field. You can find it in documentation:

https://confluence.cprime.io/display/SIL/Variable+resolution

You can not change it.

Alexey Matveev
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.
February 25, 2019

And you do not need to change it. It will be set to the currentDate, I suppose.

Daniel Völker February 27, 2019

Unfortunately, the resolutionDate is not set when using %issueKey%.resolutionId = 1; for example.

I tried to raiseEvent the 'Issue Resolved' event, still no luck. This is rather unfortunate, the event should really be triggered.

Alexey Matveev
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.
February 27, 2019

Are you on Cloud or Server? Could you provide your complete code?

Alexey Matveev
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.
February 27, 2019

Or I will take your code like this:

string issueKey = "ISSUE-193";
%issueKey%.resolutionID = 1;

Daniel Völker February 27, 2019

Yes, I tried exactly the code you posted and also something more elaborate like:


string issueKey = "ISSUE-149";
%issueKey%.resolution = "Gelöst.";
%issueKey%.resolutionId = 1;
raiseEvent("Generic Event", issueKey, currentUser());
raiseEvent("Issue Updated", issueKey, currentUser());
raiseEvent("Issue Resolved", issueKey, currentUser());
raiseEvent("Issue Closed", issueKey, currentUser());

I have no luck with the resolutionDate.

Alexey Matveev
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.
February 27, 2019

Do you use Jira Cloud or Jira Server?

Daniel Völker February 27, 2019

Hi Alexey, 

I'm on Jira Server.

Alexey Matveev
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.
February 27, 2019

Hello,

I tried your code and it worked for me.

You can use a code like this:

string issueKey = "ISSUE-149";
%issueKey%.resolution = "Gelöst";

 

And it should work. If it does not work, then try to change Gelost to the English analog as you can see in the issues->resolutions.

You can also use:

string issueKey = "ISSUE-149";
%issueKey%.resolutionId = 1;  

But I believe that your id is wrong. The id of a resolution is a 5 digit number. You can find out the id of a resolution, if you go to issues -> resolutions and then hover your mouse over the edit button. You will see a url with the id of the resolution.

Daniel Völker February 27, 2019

Hello Alexey, 

just to clarify: when you set the resolution with SIL, ist the resolutiondate of the issue also updated? That's my problem. The resolutiondate stays null.

Alexey Matveev
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.
March 1, 2019

Hello Daniel,

I asked the developers of the plugin. It is currently not possible to set the resolution date with Power Scripts

Like Iuri Pereira likes this
Daniel Völker March 1, 2019

Thank you for your effort, Alexey!

0 votes
Iuri Pereira February 26, 2021

If your problem is to fix resolution date to an specific date for N issues, there's  way to do it with JSU Plugin

1. Create a transition (e.g. Fix Resolution) in your workflow to the same final status

2. Add a post function in this transition and choose "Update Any Field (JSU)"

3. Choose "Resolved" and set to the date you wish to change

4. Publish the workflow

Make sure this transition is not changing anything but the Resolved field and make sure this transition is going to the same final status. The problem with this is that every time you need to change the final date you need to change in the transition and re-publish the workflow. 

Hope this can help!

Suggest an answer

Log in or Sign up to answer