Affects version field needs to be updated
Asked by Sreedevi Kr:

Hi All,  
Im trying to create a automation rule which will be triggered when a particular pattern version is released. Then Im trying to add this newly released version to some issues. For fetching the issues Im using JQL filter.   
The rule is getting triggered correctly and Im able to fetch the issues using filter also. Butim not able to add the newly released version to these issues. Its working strange, sometimes its updating the newly released version sometimes some other version is updating.   
I was trying to achieve it through smart values, but not able to figure out how I can write this one. Need the smart values which will add the newly released version to Affects Version/s field, if already some values are there in the field then I need to append the new version to it.


Answers:
author: Bill Sheboy
body: Hi [@Sreedevi Kr](/t5/user/viewprofilepage/user-id/5345661)

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...

To add the additional values to the Affects Version field, try using advanced edit with JSON rather than setting the values from the field dropdown list in the Edit Issue action:

<https://confluence.atlassian.com/automation/advanced-field-editing-using-json-993924663.html>

Kind regards,  
Bill

comments: author: Sreedevi Kr
body: Hi Bill,  

I have attached the rule screenshot in the above comment please check.

We first tried it to achieve through listener script, and values where updating correctly. But after updating the values if some one manual edits the field the updated values are automatically vanishing. So thats why we are trying it through automation rule and with this rule we didnt faced the issue of vanishing the updated values. But as Im new to automation rule, I was not sure how to add the advanced edit.  
I will check the link shared by you.  

Thank you


author: Bill Sheboy
body: Thanks for that image of the rule.

Please also provide images of the Edit Issue action's details and of the audit log details showing the rule execution. Those will help clarify what is happening.


author: Sreedevi Kr
body: Hi Bill,  
I have referred the link and created JSON  
![JSON.png](https://community.atlassian.com/t5/image/serverpage/image-id/338708iF09CE0802A41A495/image-size/large?v=v2&px=999 "JSON.png")

In audit log its showing like some issues got edited and in other issues it failed  
![log.png](https://community.atlassian.com/t5/image/serverpage/image-id/338709iEC69B7118AA475CC/image-size/large?v=v2&px=999 "log.png")

When I checked one of the edited issues Im not able to find any new version is added.  
I have released the version shown in below image  
![released.png](https://community.atlassian.com/t5/image/serverpage/image-id/338710i0569595FD9719075/image-size/large?v=v2&px=999 "released.png")

But in the issue its not getting updated. Is my JSON having some issues?


author: Sreedevi Kr
body: Hi Bill,  
I think I have found the issue with JSON. Now Im using   
{  
"update": {  
"versions": \[{  
"add": {  
"name": "{{version.name}}"  
}  
}\]  
}  
}  
Its working fine as of now. Im checking whether its updating all the issues listed by the JQL filter.  
If its passes all test scenarios then will prepare one document regarding this in community.  

Thank you for helping me.


author: Sreedevi Kr
body: Hi Bill,  
I have done the testing and its working fine. But I got one error "THROTTELED".  
![error.png](https://community.atlassian.com/t5/image/serverpage/image-id/338755i04901074CA768BF4/image-size/large?v=v2&px=999 "error.png")

this is what I found in log file. I am trying to update 57 issues.  
Please let me know if you have any findings regarding this


author: Bill Sheboy
body: I am using Jira Cloud, not Data Center, and so have no experience with rule throttling in those Jira sites, and...

The service limit shown in the log matches the default, maximum value of 3600 seconds per 12 hours: <https://confluence.atlassian.com/automation/automation-service-limits-993924705.html>

Have you been testing your rule so much that the processing time exceeded 1 hour (i.e., 3600 seconds)? You may review the audit log entries to confirm this.

If so, now that your rule is working you may need to wait until running the rule again. And again, with me having no recent experience with Data Center version, I would advise against modifying that limit through settings.


author: John Funk
body: Hi Sreedevi,

Can you share the entire rule here? Along with screenshots of the relevant detail steps?

comments: author: Sreedevi Kr
body: Hi John,  
![Rule.png](https://community.atlassian.com/t5/image/serverpage/image-id/338447i194AA1F65B02BF7C/image-size/large?v=v2&px=999 "Rule.png")  

Here Im triggering If version with particular pattern is getting released and Im using jql filter to fetch issues where I need to update the latest released version. But sometimes only its getting updated with latest one.  


Tags: data-center

jira-data-center