In our IdP (Okta) we have a custom text field to facilitate a specific date for people. I will be syncing this field over to a custom read-only text field in Atlassian, via MindPro Sync, so that it will be available on issues and for Automation.
I would like to setup an automation where an issue is auto-closed with comment based on that "date". If it were a true date field, I could use a smart value time comparison, but since it's a text field, I feel that wont be possible via the exact same means.
Due to the systems in place, we are locked into use text fields for this.
Does anyone have suggestions on this? Thank you for your time and consideration.
Hello @David Quiram
There are functions that can be applied to smart values in automation to convert text to dates that can then be used in date-applicable functions.
@Bill Sheboy provided an answer to a similar question on this post and this post referencing the toDate function.
Amazing! Thank you so much. I'll def be digging into those posts next week!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So, for anyone coming here looking for more information. Trudy's answer is the accepted answer as it helped point to good sources of information. I did need to reach out to support to help provide more context as I just couldn't get the formatting correct.
This is how my brain rationalized the format:
{{field_with_string.toDate("Format of Data").extraFunctions.displayFormat}}
So source data of "03 26 1990" put through this:
{{issue.customfield_10385.toDate("MM dd YYYY").shortDate = 3/26/90
{{issue.customfield_10385.toDate("MM dd YYYY").plusMonths(1).shortDate = 4/26/90
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So... I have been picking away at this for a few hours now trying different combinations to see if I could land on the solution and it's not quite catching. What am I missing?
My Okta variable has the value of March 26, 1990. I have tried this as both:
1990-03-26
1990 03 26
In the automation, I store the data into a variable {{TestVariable}} and I give it the smart value of:
{{issue.customfield_10385.toDate("yyyy-MM-dd")}}
{{issue.customfield_10385.toDate("yyyy MM dd")}}
{{issue.customfield_10385.toDate(jiraDate)}}
I then log the action so I can visually inspect what is being used. I log both the variable and the smart value for comparison and for all three variants that I have tried we get:
1990-03-26T00:00:00.0+0000
If I am reading documentation correctly, it is putting the time value in there because that is the default format for a date/time value. So, am I doing something incorrectly with my smart value?
Moving on, the next thing I tried to log was adjusting the date/time value by doing a plus 1 month to it. I tried the following and both display no data, but don't error:
{{issue.customfield_10385.toDate("yyyy-MM-dd").plusMonth(1)}}
{{TestVariable.plusMonth(1)}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Journeys is a brand new feature in Jira Service Management that helps you streamline various processes in your organization that may cross multiple departments, such as employee onboarding or off-boarding that require action from different teams. ✨
Join the EAP →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.