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

HIs it possible to set smart value exceptions?

Dmitry Alabyan
Contributor
August 25, 2023

Greetings, community!
I have an unconventional approach here - we're using one of the Business Projects as a corporate calendar, with several types of issues like sick leaves, vacations, etc.
Naturally, public holidays of the country are entered manually and are a separate type of issue.
And we also need to count days to make reports via exply. 
So we have a separate field for days count which is populated via {{issue.duedate.diff(issue.customfield_11607).abs.BusinessDays}}

Now the question: we have only business days accounted for, weekends excluded - that is fine.
But is there a possibility, maybe through automation to add to this smart value query a condition that would also ignore the dates, on which a separate type of issue (public holiday) appears?
Perhaps, via a call to the API?

1 answer

0 votes
Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 25, 2023

This is an interesting one.  I see you have this question tagged with JSM. Is it your end goal to have the JSM project automatically set due date factoring in business days and holidays? 

If yes... Instead of putting in the effort to calculate the due date, you could simply use the SLA functionality. Use the "Time To Resolution" as your "Due Date" and apply a custom calendar where you can configure holidays.  Then you can build your reporting against Time to Resolution rather than Due Date.  As each issue will give you down to the minute how much time remaining before it is in breach.

If no... I don't see a straightforward mechanism for factoring in business days and holidays.  I suppose you could do something like this:

  • TRIGGER: Scheduled (Daily)
    • dueDate IS NOT EMPTY AND resolved IS EMPTY
  • ACTION: Lookup Issues
    Assuming you're using Due Date on your business project to capture the holiday/vacation/..., this would pull in all of the issues (holidays) that occur between now and the time the current issue is due.
    • project = YourBusinessProject AND dueDate >= startOfDay() AND dueDate < {{issue.dueDate}}
  • ACTION: Edit Issue (YourCustomField)
    This will subtract the number of issues found in the lookup issues action to give you the total number of business days
    • {{#=}}{{issue.duedate.diff(issue.customfield_11607).abs.BusinessDays}}-{{lookupIssues.size}}{{/}}

NOTES

  1. This rule would need to be configured a scope for multiple projects
  2. It's not scalable - Depending upon the number of active issues when this executes, you could quickly encounter rule throttling so I would only recommend this if you're dealing with a small number of tasks.  Otherwise, you should consider a separate marketplace app.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Upcoming Jira Service Management Events