Copy Parsed Text to a Field time field
Hi Fidel,
Using "Copy Parsed Text to a Field" post function.
I'm trying to copy a time value to a text cf. However that doesn't seem to be an option. When copying for example:
Field %{12201} = 1d Field %{12202} = 2d Post Function: Between %{12201} and %{12202} Results: Between 32400 and 64800
I would like to see Between 1d and 2d.
Is that possible?
Comments (40)
-
repo owner -
reporter It's called "TIME". It's made to use for time format as "1d 4h" for example.
-
repo owner Moshe, TIME is not a standard custom field type of JIRA. Are you sure that's the name of the custom field type? Maybe it's being confused with name of the custom field itself, isn't it?
I case it's a custom field type, which plugin is providing that type of custom field?
-
reporter Hi Fidel,
We have a custom field type called time that behaves like estimated time field in Jira, I cannot seem to figure out what plugin provides that cf.
So maybe in order to help me, you can pretend I'm trying to fill the estimated time field with your post function?.
THanks
-
repo owner Has your work day 9 hours?
-
reporter Yes (I wish I can customize that as we close on friday at 1).
-
repo owner You can check up the custom field type at Administration > Issue > Custom fields, like shown in the screenshot:
-
reporter Also called time.
-
repo owner Try this text expression in advanced parsing mode:
"Between " + shortFormatDuration(modulus({12201} * 1000, 9 * {HOUR}) + floor({12201} * 1000 / 9 / {HOUR})) + " and " + shortFormatDuration(modulus({12202} * 1000, 9 * {HOUR}) + floor({12202} * 1000 / 9 / {HOUR})) + "."
You need to update to the most recent version of the plugin.
-
reporter Updated to the most recent version (2.2.31)
Not working.
JIra issue view screen:
.
-
reporter The target field is a "Text Field (single line)", if that helps.
-
repo owner You should select advanced parsing mode.
-
reporter See attached for results, Doesn't seem right.
The 2 custom fields are the Time > and Time <
-
repo owner Sorry, use the following text to be parsed:
"Between " + shortFormatDuration(modulus({12201} * 1000, 9 * {HOUR}) + floor({12201} * 1000 / 9 / {HOUR}) * {DAY}) + " and " + shortFormatDuration(modulus({12202} * 1000, 9 * {HOUR}) + floor({12202} * 1000 / 9 / {HOUR}) * {DAY}) + "."
-
reporter Hi, That worked, many thanks.
Let me ask you how to add the following at the end? " |By Current User"
-
repo owner Use this text to be parsed:
"Between " + shortFormatDuration(modulus({12201} * 1000, 9 * {HOUR}) + floor({12201} * 1000 / 9 / {HOUR}) * {DAY}) + " and " + shortFormatDuration(modulus({12202} * 1000, 9 * {HOUR}) + floor({12202} * 1000 / 9 / {HOUR}) * {DAY}) + ".|By Current User"
-
reporter I mean this type of current user "%{00021}"
-
reporter In basic mode i would have done this:
| By %{00021}
-
repo owner Then use:
"Between " + shortFormatDuration(modulus({12201} * 1000, 9 * {HOUR}) + floor({12201} * 1000 / 9 / {HOUR}) * {DAY}) + " and " + shortFormatDuration(modulus({12202} * 1000, 9 * {HOUR}) + floor({12202} * 1000 / 9 / {HOUR}) * {DAY}) + " | By " + %{00021}
-
reporter Hi Fidel,
When I do "1w 2d 4h 30m" it displays in the post function as "1w 4h 30m" or when i got "2w - 4w" I get "Between 1w 3d and 2w 6d" through the post function
please assist Thanks
-
repo owner Hi Moshe, I need to know which plugin are you using for creating Time custom fields. That way I will be able to reproduce the same behavior you are experiencing, and maybe fix it.
-
reporter Hi cannot seem to figure out what plugin provides this custom field. I will try disabling plugin by plugin and will let you know the results.
-
reporter The Epic Sum Up plugin (paid version) provides this plugin.
https://marketplace.atlassian.com/plugins/aptis.plugins.epicSumUp/server/overview
-
repo owner Hi Moshe,
Try the following text expression:
"Between " + shortFormatDuration(modulus({12201} * 1000, 9 * {HOUR}) + floor(modulus({12201} * 1000, 9 * 5 * {HOUR}) / 9 / {HOUR}) * {DAY} + floor({12201} * 1000 / 9 / 5 / {HOUR}) * {WEEK}) + " and " + shortFormatDuration(modulus({12202} * 1000, 9 * {HOUR}) + floor(modulus({12202} * 1000, 9 * 5 * {HOUR}) / 9 / {HOUR}) * {DAY} + floor({12202} * 1000 / 9 / 5 / {HOUR}) * {WEEK}) + " | By " + %{00021}
9 is the number of hours in a work-day, and 5 number of days in a work-week.
-
reporter That solved the problem.
Let me ask you on a side note, is there a way to count one of the working days as 5 hours only instead of 9 hours (as we only work 5 hours n friday)?
Thanks
-
repo owner Hi Moshe,
Sorry, but it's not possible to do it, since when you enter a duration at Time custom fields, for example "3d 1h", you don't say whether one of those 3 days is Friday, you simply are saying there are 3 days.
The only possible solution is to average the number of hours in a work-day like this: (4 * 9 + 5) / 5 = 8.2 hours per work-day, instead of 9. But you should also change the configuration in JIRA in order to make Time fields consider 8.2 hours per work-day.
-
repo owner - changed status to resolved
-
reporter Thanks Again
-
reporter Hi Fidel,
Just a quick question in regards to my issue of having less hours on friday,as mentioned above.
I'm thinking maybe there is a way to do that in the math of the "Time to be logged" in your Log Work post function, to have it minus the hours that go above the 4 hours that has been worked on Friday for example?
-
repo owner Hi Moshe, sorry but it would require a function for subtracting dates according to a custom work-schedule, which is not currently possible.
Anyway, it's in the plugin's "to do" list. You can follow and vote for the following issue: Issue
#443. I will close it once it's implemented. -
reporter Voted!
Any ETA?
Thanks
-
repo owner Sorry, not yet, but it's high on the list.
-
reporter Got it.
-
reporter Hi Fidel, I Can use some help
Using your "Copy a parsed text to a field" post function, I'm trying to parse that same above mentioned "Time" field, however this time to the "Original Estimate" field and I cannot seem to figure out how.
Please assist... Many thanks
-
reporter - changed status to open
-
repo owner Since version 2.2.34 you can use the following simpler text expression:
"Between " + shortFormatWorkDuration({12201} * 1000) + " and " + shortFormatWorkDuration({12202} * 1000) + " | By " + %{00021}
I recommend you to update and use this expression, which much easier to understand.
-
reporter I believe you misunderstood me. This time I'm trying to set the Jira system Field "Original Estimate" with the value of the TIME custom field that comes along as part of Epic Sum Up.
-
repo owner Sorry, Moshe, I didn't understood you, although your request is clearly explained. I'm very tired today :-).
Please, try "Mathematical and date-time expression calculator" with the following configuration:
- Target field: Original estimate (minutes)
- Formula:
{12201} * 1000 / {MINUTE}
Explanation: "Epic Sum Up" fields return a number of seconds while the time calculations in JIRA Workflow Toolbox use milliseconds, that's why we multiply by 1000. Then we divide by {MINUTE} since Original estimate (minutes) expects a number of minutes.
-
reporter Works now. Thanks Get some rest :-)
-
reporter - changed status to resolved
- Log in to comment
Which type of custom field are %{12201} and %{12202}?