I'm attempting to create an automation that sets due dates for each of an issue's subtasks by referencing the due date (or other custom date field) in the parent task and a date 'offset' value from a custom number field in each subtask. Our use case is that such a task/subtask scenario could be used as a template for subsequent task/subtask instances and the due date of each subtask could then be updated by simply updating the single due date in the parent task.
My thinking was that I would use something like this:
{{#=}}{{issue.parent.duedate}} - {{issue.Visit date offset}}{{/}}
but this throws errors and obviously I'm missing the point.
I'm no coder, and that's likely clear to anyone that is, so bear with me as I explore automation options. Any help is appreciated!
Hi Rick,
I think you will need to use the Diff date feature to get a number first - and save that to custom field. I would do that one one (or either) of the dates is updated.
Then you can use the proper code to set the date. Something like:
{{triggerIssue.duedate.minusDays(5)}}
John, thanks for the response. I'm not sure your thought captures what I'm trying to accomplish. Each subtask will already have a value to use to subtract from the parent task due date, so I'm not sure what using diff date will accomplish. My question ... either with your proposed approach or mine, is, once I have the offset value, how do I use it to set the subtask date?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So the offset field is a number field? I missed that, sorry.
I don't think you are going to be able to dynamically use the value of the field with the current smart values syntax. You need to use the code I have above, but I don't see a way to make the "5" in my example an actually field.
@John McKiernan1 - Any thoughts on that? Rick would like to use this:
{{triggerIssue.duedate.minusDays(5)}}
but instead of having a hardcoded 5, it would be the value in a custom field.
BTW, that would be REALLY cool!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks again, John. Yes, that's what I'm looking for. Without such an approach, the automation development would seem to be unnecessarily complex. I.e., having to have a unique condition, action, etc., for each step in a multi-step process ... or more specifically, for each subtask within its parent task. That's doable given we're basically building a mini-project template that shouldn't change often, but still less than ideal.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@John McKiernan1 @[deleted] : Any hope for me and my use case?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey @Rick Crow ,
To be honest, I am not sure but I have asked an engineer who will know and will answer you here :)
John
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey chaps,
So, you should just be able to reference the field in the minus part, eg:
{{triggerIssue.duedate.minusDays(issue.Custom Number Field)}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Looks like you owe him TWO beers now then, John ... as it works!
Which is awesome, but also kind of frustrating as, with one of my attempts, all I would have had to do was remove the extra curly braces I had used within the 'minus part.'
Thanks, Simeon and John ... you've made my day!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@John Funk , @Simmo : while I have your attention, could I possibly direct you to another question I've raised regarding automation? Any thoughts would be greatly appreciated!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No worries guys, glad it worked :D
Unfortunately, its got to be Gluten Free Beer now, that lessens my chances! :D
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey Morten - Not exactly sure what you are trying to accomplish.
If you do an Edit issue then cite the Due Date field, your code will definitely replace the Due Date with a new value.
What do you mean by "I just want a simple way of trioggering an offset/postpone of the due date field."? Can you give us an exact scenario?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi John.
I just want to trigger an event/transition which takes the original Due Date and offesets it with a numeric value(+ 30 days) - A re-occuring event based on issue data.
So basically this Automation scenario:
When Due Date < Now
Then: Due Date = Due date + customfield(numeric)
I cannot get this to work with Automation when trying to update the Due Date field with:
{{triggerIssue.duedate.plusDays(issue.customfield_20530)}}
Result: It just blanks the field
If I used a fixed value ex. 30 as input in smart value func, it works just fine - But I want the input to be flexible from a custom field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Morten Stensgaard did your question get answered? I'm trying to accomplish something really similar.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
How would I use this when "duedate" is a custom field. Would I write this as {{trigger.issue.issue.customfield_#####.minusDays(#)}}?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Simeon.
I have a similar. usecase, where I just need to offset the duedate by x days(numeric value from a custom field)
But then trying this in an Update field - action on the Due date field it just removes the existing date.
I'm using this in the Action of the update of Due Date:
{{triggerIssue.duedate.plusDays(issue.customfield_20530)}}
Custom fields contains the value 30
I just want a simple way of trioggering an offset/postpone of the due date field.
Thanks
Morten
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.