Hi guys,
i'm trying to dev an automation to Decrement the field "Total Issues in Project" when i delete any issue. So, if i delete one issue, the field will receive field -1;
but it's not that simple. When the deletion of the issue trigger the automation, it's lose the reference because, technically, the issue that triggered the automation does not exist anymore on the project.
I take this screenshot to explain better:
The code on edit item field action: {{#=}}{{issue.customfield_10177}} - 1{{/}}
Sorry my bad english,
Yours Marcello Raffles
Hmm. The overall effect of this feels like a very broken "requirement". A field on an issue is not the right place to be trying to report on the number of issues in a project, and I have to question of what possible use that information actually is?
Anyone who really needs to know it (and I can't imagine it's anyone outside the admins) can run a search for "project = XYZ" and it'll tell them how many issues are present. They're probably not really that interested in that either, it's almost certainly going to be more complex - "project = xyz and resolution is empty" to see what is in the to-do list is far more likely a question.
Anyway. To answer the question as it is, I would stop trying to increase/decrease. There's a load of reasons your counters might not be accurate. It would be far better to do
Event there would be create, delete (I very strongly recommend you remove the ability to delete issues from everyone other than admins), and move.
Well, let me explain my idea.
I have to know the exact number of tasks in a projet because i have a indicator that will return for me the % of the entire project conclusion.
To know this information, i've created first a new issue type called "Project Status", where i fill some fields manually and some with automations, in this line i've created 2 fields: "Number of tasks" and "Number of Concluded Tasks"
On the first moment, i've filled these fields with the {{lookupissues.size}} smart value, but i've noticed that smart value just return the maximum of 100 issues, so if i have a project with 101 or more issues, the return count will be 100 issues, ever.
So i've created a field "% Concluded" to return the diference between these fields and return the % of conclusion of entire project.
The first field, "Number of tasks" will receive (number of tasks + 1) in every task/subtask creation and (number of tasks - 1) in every task/subtask exclusion.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't think you can do this with Automation, you'll need something that can run the search and return the true count into your field. I'd recommend a Scriptrunner listener triggered by any create or delete event, and "move" as well (As it will need to calculate for two projects when an issue moves)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.