Issue with API Import Date (OD-2515)
Quin opened 5 months ago

So I am playing around with Postman Runners.

If I want to batch process some issues, there is an issue with any dates.

For instance, my JSON file has this value "Due Date": "1754842800000",

Now, when I POST to ~api/issues/ with all the hard-coded values, perfects no issues (and yes, it needs to be a string). However, when I save this as a JSON template for the Runner, "Due Date": "{{dueDate}}" breaks with 500 error: For input string: "{{dueDate}}"

And yet "title": "{{title}}", works fine.

Essentially 2 string fields acting differently.

Is it because Due Date is within the "fields"? I've found other "fields" to have other issues ("Invalid choice value").

  • Robin Shen commented 5 months ago

    Such bug report is unclear to me. Please describe detailed commands posted to OneDev with expected result.

  • Robin Shen commented 5 months ago

    No, I never used that. Please capture and attach the detailed json body sent to OneDev and describe the issue in more detail to save our time.

  • Brent Hitzeroth commented 5 months ago

    In C# you would use this to convert a json date to a usable value:

    var dateTimeUTC = DateTime.FromFileTimeUtc(Convert.ToInt64(result));
    

    So without knowing much detail of your code or use case you might need to do the reverse to get your string to a json compatible string:

    var dueDate = JsonConvert.SerializeObject(DateTime.Now);
    

    On the off chance this may help...

  • Robin Shen commented 5 months ago

    Closing. Please reopen if there is more info.

  • Robin Shen changed state to 'Closed' 5 months ago
    Previous Value Current Value
    Open
    Closed
issue 1/1
Type
Bug
Priority
Normal
Assignee
Affected Versions
12.0.1
Labels
No labels
Issue Votes (0)
Watchers (3)
Reference
OD-2515
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover