Post

2 followers Follow
0
Avatar

User field is not updated thru API call

Hello!

We are using Clarizen API to synch projects attributes (user fields) with our accounting system, and for several (out of hundreds that are updated OK) projects we are getting errors back from API call - see the request and response details @ https://www.screencast.com/t/fiOrzkDf1l2

We tried to compare data between the projects where user field updates OK and the projects where it fails and do not see any difference in data, so it could be something is wrong with API or with internal (not UI/API exposed?) data values for affected project.

For Clarizen's R&D staff - project id = 17w8765s4tb9q8bg6ouegs25f5431, direct link https://app2.clarizen.com/Clarizen/Project/5847504257, the field we are failing to update is "B1: BH Open Qty"

Let us know if you need another instances of affected projects.

The code we use:

    private class ProjectRecord
    {
        public string Id { get; set; }
        public string CardCode { get; set; }
        public decimal? Balance { get; set; }
    }

 

    public static class ClarizenTypes
    {
        public const string Project = "Project";
    }

 

...

...

 

        private static List<BaseMessage> BuildApiUpdateMessages(List<ProjectRecord> projects, Dictionary<string, decimal> balances)
        {
            var rez = new List<BaseMessage>(projects.Count);
            foreach (var project in projects)
            {
                decimal balance;
                if (balances.TryGetValue(project.CardCode, out balance))
                {
                    if (balance != project.Balance)
                    {
                        rez.Add(new UpdateMessage
                        {
                            Entity = new GenericEntity
                            {
                                Id = new EntityId {TypeName = ClarizenTypes.Project, Value = project.Id},
                                Values = new[] {new FieldValue {FieldName = "C_B1_OpenBH", Value = balance}}
                            }
                        });
                    }
                }
            }
            return rez;
        }

 

* project.Id never equals to null

* BaseMessage, UpdateMessage, GenericEntity, EntityId, FieldValue are defined in https://api.clarizen.com/v1.0/Clarizen.svc 

* Output of the function is pushed to http://clarizen.com/api/IClarizen/Executemethod 

Thanks in advance!

Alexey Grebennikov Answered

Official comment

Avatar

Hi Alexey,

To handle your issue I need more information about your user and organization. As sharing it here is not an option please contact our support team and open a ticket.

I hope this helps,

Elad

Elad Franklin
Comment actions Permalink

Please sign in to leave a comment.

9 comments

0
Avatar

Elad,

we have already posted the ticket @ http://success.clarizen.com/hc/requests/36036, but then Carl asked (he consulted with your director of PS) to post it here with more tech details.

Let me know if we still need to create a new ticket or if you can simply reopen existing one or if we can provide credentials any other way.

Thanks!

Alexey Grebennikov 0 votes
Comment actions Permalink
0
Avatar

Hi Alexey,

No need for additional ticket if you already opened one to support.

 

Elad Franklin 0 votes
Comment actions Permalink
0
Avatar

Elad,

Did you have a time to check our case?

Thanks!

Alexey Grebennikov 0 votes
Comment actions Permalink
0
Avatar

Hi Alexey,

Sorry for the delay.

I did not get the ticket from the support team. I've already contacted them and I will update you with the findings.

 

Elad

Elad Franklin 0 votes
Comment actions Permalink
0
Avatar

Also, if you have any other recent examples of the issue please share the error reference id that you got.

 

Thanks

Elad Franklin 0 votes
Comment actions Permalink
0
Avatar

Hi Alexey,

I've tested your code locally and it is working as expected. I think the issue here is that you have some workflows in Clarizen that cause these issues.

Can you please open a new support ticket with the new information I gave you? Please hare the ticket number here and I will make sure it will reach the right person to handle.

 

I hope this helps,

Elad

Elad Franklin 0 votes
Comment actions Permalink