Workflow transition fails with NumberFormatException

Issue #331 resolved
Carsten Kirschner created an issue

Jira Version: 6.4.12 Tempo Planner Version: 3.4.0 Java: Oracle JDK 8u72 Jira Workflow Toolbox version: 2.2.11

After a recent update to the current Tempo Versions we can no longer use our workflow transaction "Planen" for existing issues as there is an error in the validation. Newly created issues work the first time as expected, if the "Planung" State is removed the have the same Error.

This is the only log output regarding the error:

2016-06-06 15:22:16,153 http-bio-8443-exec-1211 ERROR carsten.kirschner@corussoft.de 922x1461882x1 1qe55u6 127.0.0.1 /secure/CommentAssignIssue.jspa [plugins.workflowToolbox.shared.ParserToolbox] *** PROVIDED NULL VALUE FOR STRING "Billing Key" DUE TO EXCEPTION class java.lang.NumberFormatException

This is the request which is send and contains the Billing Key Parameter which is customfield_11401

curl 'https://jira.corussoft.de/secure/CommentAssignIssue.jspa?atl_token=XXXX-XXXX-H8AG-SE5Z%7C197c0ce782f8cbdd5d39659f166ba6d2c2ed734b%7Clin' -H 'Accept: text/html, /; q=0.01' -H 'Accept-Encoding: gzip, deflate, br' -H 'Accept-Language: en-US,en;q=0.5' -H 'Connection: keep-alive' -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' -H 'Cookie: AJS.conglomerate.cookie="|workflow-mode=text|streams.view.10001=full-view|CONNECTION_CONTRACT_EXPANDED_1=true|CONNECTION_CONTRACT_EXPANDED_4=true"; JSESSIONID=834F72867889BC75FDCF405554E512B0; atlassian.xsrf.token=BVDB-KMS3-H8AG-SE5Z|197c0ce782f8cbdd5d39659f166ba6d2c2ed734b|lin' -H 'DNT: 1' -H 'Host: jira.corussoft.de' -H 'Referer: https://jira.corussoft.de/browse/TEST-59' -H 'User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:46.0) Gecko/20100101 Firefox/46.0.1 Waterfox/46.0.1' -H 'X-AUSERNAME: carsten.kirschner%40corussoft.de' -H 'X-Requested-With: XMLHttpRequest' --data 'inline=true&decorator=dialog&action=281&id=110355&viewIssueKey=&assignee=carsten.kirschner%40corussoft.de&duedate=06.06.16&priority=6&timetracking_originalestimate=1h&timetracking_remainingestimate=1h&isCreateIssue=&hasWorkStarted=&customfield_11401=544&comment=&commentLevel=&atl_token=XXXX-XXXX-H8AG-SE5Z%7C197c0ce782f8cbdd5d39659f166ba6d2c2ed734b%7Clin' The Workflow transition has the conditions as shown in the screenshot, I have tried both, the number condition {Billing Key}>0 and the string condition %{Billing Key} != null, with the same outcome.

I have crosspost this Bug Report to the Tempo Zendesk, which is not public visible. Please advice how I can provide better informations.

Comments (19)

  1. Fidel Castro Armario repo owner

    Hi Carsten,

    Can you, please, reproduce the error using 2.2.12_beta_12 and share with me the error message in the log file?

    Previously, you should set logging level for package com.fca.jira.plugins.workflowToolbox to DEBUG. You can do it at Administration > Logging and profiling > Configure logging level for another package

    Thanks,

    Fidel

  2. Fidel Castro Armario repo owner

    Hi Carsten,

    It seems that "Billing key" custom field has been removed in recent versions of Tempo, and has been replaced with "Account".

    If you want to check that "Account" is set you can use the following boolean expression:

    %{nnnnn} != null
    

    replacing nnnnn with field code for Account.

  3. Fidel Castro Armario repo owner

    Please, try version 2.2.12_beta_13. This version should solve your problem, but setting field Account (Billing key in your case) doesn't work, as it used to do. I'm trying to solve this problem also.

  4. Carsten Kirschner reporter

    Beta 13 works. Thanks

    The picture of the tempo settings shows that Billing Key is in fact of typ Account. Typo3addonFields.PNG

  5. Carsten Kirschner reporter

    From tempo Support [quote] Hi Carsten,

    The NumberFormat exception is most likely because the Account custom field has been changed in Timesheets 8 from a java.lang.Double value to a com.tempoplugin.accounts.account.api.Account, returning the Account object instead of the ID. That would explain the NumberFormat exception as the validator is trying to validate a number to an Account object. [/quote]

  6. Fidel Castro Armario repo owner

    Partially fixed in just released version 2.2.12.

    In Timesheets 8.x Account custom field now can be read, but cannot yet be set.

  7. Fidel Castro Armario repo owner

    Hi Kian,

    I don't know yet. I have to investigate it. I hope I will have news in a few days.

  8. Martin Widemann

    Hi!

    I had the same problem too and tried to explain it to the TEMPO Support. Unfortunately they couldn't reproduce or didn't understand the problem.

    Now on JIRA Workflow Toolbox 2.2.12 I did some tests with the following results...

    • %{11405} != null -> Incorrect: Is NOT validated; Empty value is accepted in Creation Form
    • {11405} != null -> Incorrect: Is NOT validated; Empty value is accepted in Creation Form
    • %{11405} != "" -> Incorrect: Is NOT validated; Empty value is accepted in Creation Form
    • {11405} != "" -> Error: Throws PARSE ERROR in JIRA Workflow Toolbox
    • %{11405} > 0 -> Correct: Is validated; Empty value is NOT accepted in Creation Form
    • {11405} > 0 -> Correct: Is validated; Empty value is NOT accepted in Creation Form

    (11405 = Account)

    Regards

  9. Fidel Castro Armario repo owner

    Hi Martin,

    The correct syntax to make account compulsory is:

    {11405} >= 0
    

    since {11405} returns -1 when not set.

    Please, let me know if it works for you.

  10. Fidel Castro Armario repo owner

    %{11405} represents a string value, while {11405} represent a numeric value. When you use %{11405} > 0 you are indeed comparing lexicographically (same order as words in a dictionary), and 0 is automatically converted to string "0", i.e., it's equivalent to %{11405} > "0". Lexicographically "11" < "2".

    The correct expression is {11405} >= 0.

    Do you have any problem with all this?

  11. Fidel Castro Armario repo owner

    Thanks for the feedback, Patrick. Which version of Tempo Timesheet do you have installed?

  12. Log in to comment