The community will be in read-only from Tuesday 11:59pm (PST) to Wednesday 7:30am (PST)
The community will be in read-only from Tuesday 11:59pm (PST) to Wednesday 7:30am (PST)
Service Desk Practitioners Forum
cancel
Showing results for 
Search instead for 
Did you mean: 

Problem writing SC fields "Registration" and "created by" via WEB API

SOLVED
Go to solution
Highlighted
Uli Manschke
Collector

Problem writing SC fields "Registration" and "created by" via WEB API

A customer wants to anonymise certain ServiceCall fields in SD, I suppose for reporting purposes.

Via the WEB API, this works fine except for two fields: "created by" and "registration".
These two seem to have some special "anchors" in SD - they cannot be overwritten by the web api, the call returns

"Program error: the attribute 'created by.' of this registration cannot be modified, because the registration item was opened in view mode or because the attribute is read-only."

This is even though the fields are set to "write" in the field access definitions, and even if the operation is done using the "system" account.

In all forms, both fields appear as "read only" (grey) irrespectively of their field definition.

Any idea how these fields can be made writeable for the WEB API? We cannot use direct SQL access to the DB - this would drop the support of the product.

Thanks a lot!
uli
HP Software PreSales technical consultant
8 REPLIES
Uli Manschke
Collector

Re: Problem writing SC fields "Registration" and "created by" via WEB API

Just to add:
I've checked the fields with SQL Manager - all SC field names in the db start with "SER_", except these two, which start with "REG_". Don't know if this is relevant.
HP Software PreSales technical consultant
Gerry Allardice
Honored Contributor

Re: Problem writing SC fields "Registration" and "created by" via WEB API

Uli,
From my experience you can't write these with the API, and probably by design.

Registration is the time it is created, so you should not need to set it and should not be able to play with it, Created by is who did it, again you should not be able to rewrite history, who create it is who created it.

You could go down the path of copying Registraion to another time and date, copying Created By to another field using UI rules for normal calls, and set them by the API for you special calls, and do the reporting off the new fields.

Regards
Gerry
Uli Manschke
Collector

Re: Problem writing SC fields "Registration" and "created by" via WEB API

OK, Gerry, I this helps to understand what it's good for. Nevertheless - the customer wants to anonymise these two fields (the germans don't want anyone to be able to trace them :-), so this is a requirement we must fulfil, if ever possible.

So I'd like to know why these fields are non-writeable and how this could be changed - then we decide whether we can do it or not.

Does anyone know why these fields are read-only? Which DB or SD feature restricts this?

Thanks a lot again!
uli
HP Software PreSales technical consultant
George M. Meneg
Honored Contributor
Solution

Re: Problem writing SC fields "Registration" and "created by" via WEB API

Hello,

You *CAN'T* alter Registration and Created By from WEB API or ANY API whatsoever.

The only thing you can do is using a generic account for registering tickets through web-api.
menes fhtagn
Uli Manschke
Collector

Re: Problem writing SC fields "Registration" and "created by" via WEB API

George, Gerry,
thanks for your valuable input; George seems to be right - afaik there IS no supported way of changing these fields. Directly using SQL to change field content is drops support, so this is no option.

The customer now agreed to a workaround like Gerry suggested:
- use generic names like "callagent1" for logins,
- use a new field for listing the real agent names while the call is open (they'll use an external mapping table "genericname-realname") so filling this field can be automated)
- later then anonymise the realname field.

This solves the problem, that at least in the call record itself and ServiceDesk there is no direct linkage between call data an callagent name.

Regarding the "Registration" field, the customer agreed to (or better: had to agree to :-() drop the anonymisation of this field.
HP Software PreSales technical consultant
Radovan Skolnik
Honored Contributor

Re: Problem writing SC fields "Registration" and "created by" via WEB API

George, sorry to say, but you're completely WRONG! Uli, there is a way to change this altough it requires a "hotfix". We're running this very thing here - writing through WEB-API to those fields (it was needed to be able to simulate creation of ServiceCalls in the past). Send me an e-mail to radovan@skolnik.info and we can discuss possible solution ;-)
Tim Schmitt_4
Frequent Visitor

Re: Problem writing SC fields "Registration" and "created by" via WEB API

If memory serves, the system is programmed to act differently when an account named 'migration' is used. It's been a long time and I'm not positive on the name but I remember that there is a way to create an account that has the ability to write to every field, even the registered date. Whether this account would work through the API is another matter...

I was looking into this for a data exchange but decided against it because using the account also disabled some of the features I liked, such as looking up and relating the caller's organization. I'm not sure if the use of the migration account is presents other risks.

If you want to experiment, trying making an account named migration (I think it needs the system admin role as well) and then using it for with your api.
Radovan Skolnik
Honored Contributor

Re: Problem writing SC fields "Registration" and "created by" via WEB API

Tim,

interesting idea. But as far as my memory serves, migration account cannot be used with WEB-API. But I may be wrong and in such case it could work.
//Add this to "OnDomLoad" event