Post

2 followers Follow
0
Avatar

Timesheet Update via API ValidationRuleError

Hi,

 

I'm trying to update a timesheet on a milestone. When I do a put request to 

/data/objects/timesheet

with the following body:

{
"workitem": "/Milestone/-----",
"reportedby": "/User/-----",
"duration": {"unit": "Hours", "value": "1"},
"reportedDate": "2021-06-28",
"comment": "testing",
}

I get the following error:

{'errorCode': 'ValidationRuleError', 'message': '"Billing Note" is required for timesheet entries on billable work items.\r\n', 'referenceId': '13PegM6HpXRmssIhwHZ2Og'}

I've tried adding variations of "Billing Note" to the request body, but haven't had any luck. What is the billing note field?

Sujammi Answered

Official comment

Avatar

Hi Sujammi,

This seems to be caused by a custom validation rule in your settings. Please go to Settings >> Configure >> select Timesheet on the left hand side >> Validation Rules. This should show you all custom validation rules. Please review them all and let me know if this helps.

Thank you,

Roland

Roland Pumputis
Comment actions Permalink

Please sign in to leave a comment.

3 comments

0
Avatar

Hi,

I've reviewed the validation rules and you're right, we have a couple custom ones. One of them is to provide a "Billing Note" to each timestamp request. So is there a way I can send that value through the API?

Sujammi 0 votes
Comment actions Permalink
0
Avatar

Hi Sujammi,

You can definitely populate this field via API. In Settings >> Configure, you can look up the API name of this field. Maybe it looks something like C_BillingNotes. If it's a text field, your API call body should look like this:

{
"workitem": "/Milestone/-----",
"reportedby": "/User/-----",
"duration": {"unit": "Hours", "value": "1"},
"reportedDate": "2021-06-28",
"comment": "testing",
"C_BillingNotes": "some text"
}

I hope this helps.

Roland

Roland Pumputis 0 votes
Comment actions Permalink