You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.
View groupJoin the community to find out what other Atlassian users are discussing, debating and creating.
Hello,
I am attempting to define an automation rule such that when a request is submitted meeting certain criteria, the ticket description will be searched for formatted text following the phrase "Due Date: ", and that text will be used to set the ticket's Due Date.
For example, imagine that the description was simply "Due Date: 2020-12-03". The question would be what Smart Text rule to define in order to set the Due Date to 12/3/2020 (within the blank under "Edit issue").
Here's what I've worked out so far, which is probably completely off-base regarding the syntax for chaining smart text functions together, but which I hope illustrates what I'm after. In my searches, I couldn't find much in the way of examples for doing this sort of thing:
{{issue.description.convertToDate(substring({{#=}}indexOf("Due Date: ")+10,{{#=}}indexOf("Due Date: ")+19))}}
For posterity, I figured this out. Here's what I wound up doing:
{{issue.description.substringAfter("Due Date: ").left(10)}}
Hi @Joshua Carr
How are you handling missing/invalid values following the text "Due Date: "? Perhaps with a condition before attempting to replace the existing field value?
Best regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm actually not. In this case, there's a form that feeds the field, and the form enforces DD-MM-YYYY formatting.
I imagine that it's possible to set things up to account for a degree of variant entry in case the date entry was free-text, but I imagine it would take a lot of work or would require use of already-developed tools. And of course typos are always possible in that case.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Bill Sheboy - As I continued work on this, I wound up needing to handle variable-length values. I did it by outputting all the non-whitespace characters between two string matches. Here's an example:
{{issue.description.substringAfter("Client Name:,").substringBefore("Account Executive:").trim()}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Catch up with Atlassian Product Managers in our 2020 Demo Den round-up! From Advanced Roadmaps to Code in Jira to Next-Gen Workflows, check out the videos below to help up-level your work in the new ...
Connect with like-minded Atlassian users at free events near you!
Find an eventConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.
Host an eventYou're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.