The thing is: I have 2 customfields, first is a number type field, second is URL type field.
When a user modifys the number type customfield, I want to copy that value into an another customfield(which is the URL type field).
The URL field has a Prefix, and the end will be the value of the number type customfield that the user just typed into the number type field.
I succesfully solved this problem wih Automation, but when I getting the value of the modified customfield(number typed), it will put comma inside the numbers. Like: 1 -> 1.0
How can I replace those commas?
In My Automation rule, my "additional fields" JSON is:
{
"fields": {
"My URL Customfield": "https://someurl.com&id={{issue.customfield_10071}}"
}
}
I tried to use smart values - JSON functions but, it won't worked for customfields somehow...
Thank you for your help,
Zoltan Erdos
from the looks I solved the riddle - but please do an own test. Happy if you can confirm if it is what you were looking for.
I am just showing the difference to your JSON snippet, do let me know if you need further information:
{
"fields": {
"customfield_10082": "https://www.example.com&id={{customfield_10081.format("###")}}"
}
}
Cheers,
Daniel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The number field is translating to float value. I don't think you can convert that easily. so it's better you simply use text custom field rather than number field type. If you still want to use the number field, then you should look at the functions for maths expression, like rounds().
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks, I think maths expressions are not solve my problem here. (eliminate comma)
Okay, I can change it to Text Field, but I wanted that the user only can type numbers to this field, and with text field how it is possible?
I need to implement some triggers to the workflows?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I know script runner can do such which is an additional addon and cost. however ensuring the text field is of type numbers with validators with Jira's native feature I don't think that exist except what you can do is create a third field of text field type, copy the value from the number field type into the text field and use the text field in the url field.
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.
Unfortunately, it won't work, but it is logical.
I copied from number field into a text field, but the moment that I copied into a text field, it copied with comma into it, just like when i copied into URL field from number field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Probably better to simply just use a text field. I checked on the Workflow feature for validators there's an option you can actually use as a validator with "Regular expression check" that should help validate for number input on the workflow for the custom field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yeah, that could work if I put it to every transition. But what will happen when the status of the issue doesn't change, just somebody modify that customfield? The validator will triggered when there is a transition, right?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, the validator will only trigger when there is a transition. The best scenario here is to use an advance script such as script runner but again that's just additional cost. which i won't recommend for this type of use 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.