How to setup a rule to archive the rule when the status transition to DONE?
Asked by Michelle Kha:

Hi, I used a rule template to setup a rule to archive the idea when it transitioned to DONE status. The rule requires that I set an issue action. However, there is only an option to delete the idea which is not what I want. There is no option to archive the idea.

I also tried to select the field "Idea Archived On" and set the smart value {{now}} to it but the rule failed and I have attached the error message.

![Capture.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/309523i71B505161A04F714/image-size/large?v=v2&px=999 "Capture.PNG")  
Please help.


Answers:
author: Nick H
body: Hi [@Michelle Kha](/t5/user/viewprofilepage/user-id/5441932) ,

It sounds like you might be trying to use the existing archive template, but if that's not the case and you are unaware - there is an already existing template within each JPD project to easily configure an automation that archives an idea when it's transitioned to a Done status:

![archive1.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/309529i8F7CEE6E818A059B/image-size/large?v=v2&px=999 "archive1.jpg")![archive2.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/309530iEC5AB971AF8CC021/image-size/large?v=v2&px=999 "archive2.jpg")

The error you shared *seems*like the automation is trying to edit some other fields besides archiving the idea. I could be wrong, but it's a strange error.

There is also the option to configure this within the Project settings \>\> Workflow tab of a JPD project. You'd want to select the transition of the Done status and add a rule:

![archive3.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/309531i3A1D088D525A2D29/image-size/large?v=v2&px=999 "archive3.jpg")

The rule would look something like the one below to archive the idea when they are transition to Done:

![archive4.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/309532i90809597136537A9/image-size/large?v=v2&px=999 "archive4.jpg")

That error you shared could also be related to the Automation for Jira user not having JPD permissions. We've recently notice some customers seeing strange errors like yours, so the A4J user would need JPD permission granted in order to execute the automations for JPD.

Unfortunately this is not something that can be configured within the admin hub, but [JPD support](https://support.atlassian.com/jira-product-discovery/) can assist with enabling this if you open a ticket with them.

comments: author: Michelle Kha
body: Thank you so much for your response. I did exactly the same as you suggested but the rule keeps failing. It won't set the value to the field "Idea Archived" and complaining that this field doesn't exist. Although this template said transition idea to archive, there is no action to actually move the idea to the Archive folder. What you illustrated here is simple updating the fields "Idea Archived" and "Idea Archived On".

Thanks again.


author: Bill Sheboy
body: Hi [@Michelle Kha](/t5/user/viewprofilepage/user-id/5441932) -- Welcome to the Atlassian Community!

For a question like this, please post an image of your complete automation rule, images of any relevant actions / conditions / branches, an image of the audit log details showing the rule execution, and explain what is not working as expected. Those will provide context for the community to offer ideas. Thanks!

Until we see those...

When I checked, there appear to be three fields set when an idea is archived. In my Jira site they were:

* "Idea archived by" -- this has a user structure, and is probably set using the accountId attribute
* "Idea archived on" -- this appears to be in the jiraDateTime format
* "Idea archived" -- this has a value attribute, apparently set to "Yes" for archived issues

It is unclear if any other fields were set by archiving, as we are straying into undocumented areas of JPD. Perhaps try setting all three with your JSON in the rule.

If that does not work, a work-around I used for this scenario with another team was to add a custom field to show / not show an idea, and toggle that when transitioned to Done using a rule. Then we updated the view filters to hide them based on the custom field.

Kind regards,  
Bill

comments: author: Michelle Kha
body: Thank you for your suggestion. I think I will probably have to use the last suggestion to show/not show the idea.

Thanks again.


author: Mari-Ann Eriksen
body: Got similar message when setting up same automation. What I needed to do, was to go into the rule details and change the actor from "Automation for Jira" to my user. Maybe a bug with that user in JDP?

comments: author: Nick H
body: Hi [@Mari-Ann Eriksen](/t5/user/viewprofilepage/user-id/5433955) ,

As mentioned above, that is related to your A4J (Automation for Jira) user not having the correct permissions to preform rules within JPD. Not entirely sure it's a bug, but we're aware this has been happening with customers lately.

If you open a ticket with [JPD support](https://support.atlassian.com/jira-product-discovery/) - they can assist with granting the A4J user with the correct permissions.