Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

JMWE - Setting the value of a field with scheduled actions

Hello everyone,

 

I am trying to automate some reports from Jira, to try and control issues already over budget (Time spent > Original Time Estimate) and try and prevent other issues from going over budget. 

I couldn't do this by simply using filters (as you can't compare two field with JQL expressions) and therefore I had to resort to using JMWE scheduled actions to populate a custom field (which I called, imaginatively, "Over Budget?" - a number only, single line custom field) with two values "0.75" (for issues where time spent is > than 75% of the original time estimate) and "1" (for issues already over budget). I can then create a filter and a subscription on the back of these values to automatically report on whether we are keeping in budget or not.

I then proceed to create the following post functions within the same shared action:

Capture.PNG

The issue is that the 0.75 one applies to tickets over budget as well and I can't really wrap my mind around why this is happening.

The warnings I am getting are all the same:  "Error while calling Jira REST API. Retrying." - possibly related to time outs due to the high number of issues that need to be crunched by the post functions (> 500) 

I get two different type of errors:

- Unexpected response: 500 (possibly related to the post functions timing out)

- Cannot set property 'issuekey' of undefined (I don't understand this at all tbh)

FYI the scope of the shared action is: 
issuetype = task AND status != done AND originalEstimate > 0 AND timespent > 0

Think there's something pretty obvious I am not seeing - any suggestions on how to get this to work? 

 

thanks

1 comment

Hi,

one problem is with the syntax of your conditional execution condition. The "AND" should be inside the {{ }}.

Also, you don't need two post-functions for that - instead, you should set the field's value based on the condition:

{% if issue.fields.timespent >= issue.fields.timeoriginalestimate %}
1
{% elif issue.fields.timespent >= issue.fields.timeoriginalestimate * 0.75 %}
0.75
{% endif %}

As for the 500 errors, they are internal Jira errors, and if they persist, you'll need to reach out to Atlassian support so they can investigate.

Also, note that your approach will not fully work, as there is a limit to the number of issues the scheduled action can process, and you'll be reaching it quickly. What you need is "calculated fields", and this is something Atlassian might eventually bring to Jira Cloud.

Comment

Log in or Sign up to comment
TAGS
Community showcase
Published in Apps & Integrations

🍻🍂Apptoberfest Update: Upcoming Virtual Events 🎉

Hello Community! I hope you've been enjoying the 🍂Apptoberfestivities🍂 (I know I have!) The event is heating up next week with a series of virtual events that we're calling the 🍻🍂Partner App ...

328 views 3 14
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you