Hello, I'm trying to automate the process of filling estimated hours in my project. What I am trying to do is to get the input from a field (text), for which at the moment I'm testing out using just the description field.
The idea is to be able to manipulate the string of the field to automatically add it to the Original Estimate field. I am trying at the moment (without success) using Project Automation, New Action > Edit Issue.
I have 2 scenarios for which I need help:
1. Let's say I have in description the following value: 100 hours
I want to use jira automation to get this value copied from the description field over to the Original Estimate one. When trying it directly, the word "hours" isn't recognised in the field, so it needs to be replaced to "h".
2. Another example is when I have something different than hours in the description and I need to do some calculations with it.
Let's say I'm translating and the scope is 10000 words, which take 500 words an hour, so when having in description "10000 words".
I need to be able to remove the word "words", divide the number by 500 and add "h" at the end and copy it to the Original Estimate field.
Hence I would like to know if there's a way to manipulate text strings using Json so I can just say. Where "hours" replace it with "h".
Thanks in advance!
This JSON works fro the 100hours (without space) situation.
Changing de regex could make it work for any other cases.
{
"fields": {
"description": "{{issue.summary.jsonEncode}}",
"timetracking": {
"originalEstimate": "{{issue.description.match("(?:.*)\s(\d+)hours")}}h"
}
}
}
Hello, thanks for your answer Fran. unfortunately I get an error when trying to run it.
Description in the field:
In the automation rules it looks like:
Error:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The regex is prepared for finding the text after some other text, change it by deleting (?:.*)\s and It will find the 'xxxhours' at beginning of the line, if you add \s* it will find 'xxx hours' with or without space between the number and the word hours.
playing with the regex you can make this work fine.
I recomend you https://regexr.com to try and to learn about regex
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Fran! I was able to make it work in all cases, thanks for the help and the recommendation on regex, will definitely have a look to learn more.
Have a nice day!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Did you catch the news at Team ‘25? With Loom, Confluence, Atlassian Intelligence, & even Jira 👀, you won’t have to worry about taking meeting notes again… unless you want to. Join us to explore the beta & discover a new way to boost meeting productivity.
Register today!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.