a week ago - last edited a week ago
Error calculating input for field 'myField': wrong number of arguments (given 1, expected 0)
I need help figuring out what this error means--why does it expect 0 arguments? How can I fix this?
This is the formula that I have mapping to the field: [DATAPILL]&.to_date(format:"MM/DD/YYYY")
Please let me know if any additional info is needed. Any guidance is appreciated, thank you!
Wednesday - last edited Wednesday
Thank you, this advice has helped me reach a solution. I did need to alter the datapill date instead of just the formatting, which I did with a string instead of the suggested integer conversion method. This is ultimately what worked:
Wednesday - last edited Wednesday
That "Service Date" field - is something you have access to check the schema?
If so, can you paste it here?
Wednesday
I have the same concern as @gary1 regarding those 'dates' you're receiving. 22 can be either 2020 or some other year of any other century (I'm ignoring your business logic and industry).
In any case, if you still want to go hardcore with such solution, you need to correct your example to add these parenthesis:
Wednesday - last edited Wednesday
Update: I tested the original formula and it outputs "20022-05-15", so maybe that's a valid year, but it's obviously incorrect.
Original post:
rpatrick said it worked, but I'm kinda of surprised...
I think the first parenthesis needs to come after "2" + ( like this:
"2" + ( [Last Provision Date]&.to_s&.slice(1,9) )&.to_dateIf the intent is to slice "0022-05-15" to "022-05-15"...
And then concat "2" + "022-05-15" to make "2022-05-15"
This way the slice happens before the concat, otherwise it would end up as "20022-05-15", and then the slice would output "0022-05-15" again! Maybe?
Side note: I had no idea you could use "if" in formula mode. I always used the short form ternary operator, like:
[condition] ? [if true] : [if false]In this case you could do:
[Last Provision Date].present? ? "2" + ( [Last Provision Date]&.to_s&.slice(1,9) )&.to_date : "" ## or nil
Wednesday - last edited Wednesday
Hello!
Is your input a text or date/time input?
Can you paste here the schema of that input field specifically just to confirm it is using the correct type?
Sometimes the platform screws up by setting the render_input and parse_output attributes.
If you have something like this:
{
"name": "test",
"type": "date_time",
"optional": false,
"label": "Test",
"control_type": "date_time",
"render_input": "date_time_conversion",
"parse_output": "date_time_conversion"
}...or this...
{
"name": "test",
"type": "text",
"optional": false,
"label": "Test",
"control_type": "date_time",
"render_input": "date_time_conversion",
"parse_output": "date_time_conversion"
}Just remove the render_input and parse_output attributes, since your Jira action is expecting the date not in ISO8601 format.
Cheers!