Hi!
I'm figuring out a consumer service solution for a client with with Jira Service Management.
Now they are looking for a solution to get the Manufactured date being calculated automatically based on the given Best Before date + a certain amount of dates given.
For example, the Best Before date was 2.3.2021 and the Manufactured Date was 2.3.2021 x 50 days.
They would like to have both these fields visible on a ticket and be able to view and filter reports based on those.
How would this be possible to execute?
Thank you for the support!
Have you tried doing this with an automation?
Create an automation that triggers when the ticket is created.
Create a variable taking the value of the date field adding 50 days. (This is what it would if you used the created date of the issue.
{{issue.created.plusDays(50)}}
Set the date you want with this new value?
I think this would work.
pat
Hi!
Thank you for the comment.
The issue create date isn't the same as Best Before date.
We have a form that creates a new ticket. On that form is a field, where a client sets a Best Before date on a date field.
From that Best Before date field the Manufactured Date would need to be calculated.
The date also needs to show somehow on the ticket on a field next to the Best Before date field. It also needs to be on a format we can show in the reports and compare it next to products etc.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So the automation should
I can get the automation components correct, but not the variables. :/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
OH, I realized the createddate wouldn't be the same, that's just what I used to test my theory, I figured (perhaps mistakenly) it would work on a custom field.
https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/
This page lists the functions you can use with Date/Time
I haven't had a chance to test this out, but what if you have your automation that runs on Creation.
You call "Create variable"
Set variable name to ManufactureDateVar
Set value of variable to BestBeforeDate.minusDays(50)
Call "Edit Issue Field"
Set Manufactured Date field to your new variable {{ManufactureDateVar}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I just tested it out and it worked as I suspected it would, the one hairy part I kind of had to fiddle with was how to access a custom field's smart value.
There are instructions here:
https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/
Basically, I looked at the JSON and found the value for the custom field and entered it in as the variable value.
newDate
{{issue.customfield_130232.minusDays(50)}}
And then I added newDate to the field I needed to have it in,
{{newDate}}
So, my theory was correct and it should work for you.
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.