I'm having trouble writing the automation for a task due date to be 1 week before an event date.

Lisa Mills February 20, 2024

I'm setting up an automation for recurring events. Since our process is the same for each event and tasks are typically due at the same timeframe based around the event date, I'm trying to write the smart value to automatically set a due date for a week before an event date. Can someone please help me with this value. I'm afraid I don't understand it with the articles in here. I kind of need this one broken down like I'm 5 years old, please... 

2 answers

1 accepted

1 vote
Answer accepted
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 20, 2024

Hello @Lisa Mills 

Please provide screen images that show the complete rule you have constructed so far.

What is the name of the field where you record the "event date"? What type of field is it; just Date or Date/Time?

When is the event date filled in?

What if the event date is changed?

 

Lisa Mills February 20, 2024

Here is the build I'm working on. The two dates inside the red box are what I'm trying to manipulate. I want to be able to set the event date when I create the parent task. The child tasks are the automation and I'd like to be able to set certain task to have due dates based on when that date is set to. For example, this rule shown would be one week before the event date. By the time it's getting put in here, the date is set and does not change. It's a webinar, so there's no reason to change it. I hope this addresses your questions... Screenshot 2024-02-20 161202.png

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 20, 2024

So your rule is triggered when a "ChiroTouch Webinars" type of issue is created.

Then your rule tries to create a new issue of type "To Do" in the project "Marketing". And you want to set the Event Date and Due Date in that new issue.

Question 1: In what project does the ChiroTouch Webinars issue get created?

Question 2: You said the Due Date should be a week before the Event Date. But what should the Event Date in the "To Do" issue be getting set to?

 

I also see that you are trying to make the ChiroTouch Webinars issue the parent of the "To Do" type issue. Can you explain your issue hierarchy?

By default Jira's issue hierarchy has three levels:

Epic (a built in issue type)
|-- "standard" level issues (i.e. Story, Task, Bug)
|-- "subtask" level issues

You can create new issue types at the "standard" level, and you can create new issue types at the "subtask" level (but only for Company Managed projects).

An issue can have as its parent only any issue for the level directly above it.

So I am curious about you two new issue types and in which level each exists. You may not be able to make the Chiro issue a parent of the To Do issue.

 

Also, are what is the Type of the project(s) where you are creating these issues? You can get that information by going to the Projects menu, selecting View all projects, finding your project on the list, and looking at the Type column.

Like Kalyan Sattaluri likes this
Lisa Mills February 20, 2024

Basically, this is our Marketing Board. It's broken down by months. From there, each event or marketing campaign is its own issue. From there, each issue has its individual tasks that need to be completed for that campaign. I'm attaching the screenshot of how I use Jira. This one is specifically for a recurring event we call a ChiroTouch Webinar. We have 4 activities, the one in the first screenshot is the first activity. The event date is set on the ChiroTouch startup and there is a rule for that to carry through to any child issue. That was an automation I had set up a long time ago, so I just assume it can run that rule then, the due date rule.Screenshot 2024-02-20 163846.png

Lisa Mills February 20, 2024

Sorry, I forgot to answer your first question... Everything I do is in the Marketing Board. I've just found my automations seem to run better when I just tell it Marketing to begin with. It never changes to another project board.

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 20, 2024

I can see from your image that you are using a Team Managed Software project. And I believe your Chiro issue is a "standard" level issue and the one you are trying to create is a "subtask" level issue.

To confirm that can you provide a screen image of what you see when you go to Project Settings > Issue Types? Specifically I'm looking for the information on your issue types and hierarchy, like this.

Screenshot 2024-02-20 at 4.33.07 PM.png

If the tasks you are trying to create are actually "subtask" level issues then you need to use a different action to create them.

 

Once I have confirmation of your issue hierarchy I'll be able to provide definitive guidance.

Like Kalyan Sattaluri likes this
Lisa Mills February 21, 2024

Good Morning! My apologies for not getting back to you yesterday. Here is that hierarchy. I hope this is helpful for you... I appreciate your help so much! It's saving me so much time in the long run! Screenshot 2024-02-21 085137.png

Like Kalyan Sattaluri likes this
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 21, 2024

Great! That confirms the Chiro issue type is a "standard" level issue and the "To Do" issue type is a subtask.

If you have a separate rule that will copy the Event Date from the Chiro issue to the "To Do" issue, then you don't need to set that field when you are creating the "To Do" issue. 

To set the Due Date in the "To Do" issue based on the Event Date, which is going to be pulled into the issue in a separate rule, you can reference the Event Date of the parent/trigger issue with a smart value.

Using {{triggerIssue}} tells Jira you want to look at the information in the issue that triggered the rule.

You can then add a field name after that to reference the information in a specific field.

{{triggerIssue.Event Date}}

That will get you the Event Date from the issue that triggered the rule (the parent Chiro issue).

There are functions you can use to calculate a new date based on an existing date value. That information, and other date/time manipulation functions, is listed here:

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/

Specifically you would want the "minus" function if the Due Date needs to be earlier than the Event Date. You would use the "plus" function if you needed to calculate a date that was later than the Event Date.

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/#Date-minus-unit---

Date minus unit {{[date].minus[Unit]([number])}}

You need to decide how much you earlier the Due Date needs to be, determining the unit (i.e. calendar days, business days, weeks) and the quantity. Let's say you want the Due Date to be 5 business days earlier than the Event Date. The smart value you would use is

{{triggerIssue.Event date.minusBusinessDays(5)}}

You would type that into the entry field for the Due date in your Create Issue action.

Screenshot 2024-02-21 at 11.11.36 AM.png

Screenshot 2024-02-21 at 11.14.30 AM.png

Smart values can be case and space sensitive. The "I" for "Issue" in "triggerIssue" must be capitalized. The field name "Event Date" must match the capitalization and blank spaces of the actual field name.

Smart values can be used to set field values, in calculations, in comparisons, and many other places in Automation rules. To learn more about the available smart values refer to this document:

https://support.atlassian.com/cloud-automation/docs/smart-values-in-jira-automation/

 

Let me know if that helps you solve your requirement, or if you have more questions.

Like # people like this
Lisa Mills February 21, 2024

This was extremely helpful!!!! Thank you so much! I've been able to implement this for all of my event types. Really appreciate your help!

Like Trudy Claspill likes this
0 votes
Kalyan Sattaluri
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 20, 2024

Hello @Lisa Mills 

When you say, automation for recurring events, what do you have in mind? Send daily emails? Set up tasks? Share some of your thoughts on what do you want to do given that time window is here.

Also, this event date you mentioned, is this value stored some where? Maybe in a field in a story etc.. Or is it a pattern like 1 day of every month, or bi weekly etc?

I am hoping you are not completely new to automation as we can share the recipes based on what you mention, but its always good to be familiar with what it can do so you can adjust these as you need when time comes.

Please share your feedback.

Lisa Mills February 20, 2024

I'd be happy to explain. We do a webinar with a business partner monthly. There are tasks that need to be completed for each occurrence of this webinar. I'm trying to set up an automation, so that when I say it's this type of event, it populates those tasks and due dates based on the event date I set upon creation. I'm attaching the screen grab here. The red box are the dates I'm referring to. Thank you for your help! Screenshot 2024-02-20 161202.png

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
TAGS
AUG Leaders

Atlassian Community Events