Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Error :Error 403: ForbiddenCRRRS8658E The server cannot validate the User attribute with the value. When trying to update attributes through a script

I am trying to update values of particular attributes using a script. Each time I run my script I get an error, " response: Object, status: 403, responseText: "Error 403: Forbidden Error 403: Forbidden CRRRS8658E  The server cannot validate the User attribute with the  value.
Requirements Management/5.0</i></p></body></html>", xhr: XMLHttpRequest, log: false, ioArgs: Object, correlationData: undefined }

This is my code:

var attributeValues = [];
                result.data.forEach(function (aa /* Artifact Attributes */){
                    for( var prop in aa.values){
                           aa.values['Verified Waiver Count'] = waiverCount;

                           toSave.push(aa)
                });
                RM.Data.setAttributes(toSave, function(result){
                        if(result.code !== RM.OperationResult.OPERATION_OK)
                        {
                            console.log("could not be saved");
                        }
                });

I can see that the waiverCount gets calculated through the web console. Each time I run it I get "could not be saved". I'm not sure if it's my code, or server, or permissions that causes the errors.


0 votes


Accepted answer

Permanent link
Hy Pooja,

If you read about the 403 state you'll see it means forbidden.
This has mostly to do with the POST statement.

So it could have to do something with the rights you'll execute the script.
Do you use OAuth?

Or, where do you define "waiverCount"?
It could be, because your in {}-brackets, it'd loose it's context (check if "this", are the same inside and outside the brackets)

does "toSave" loose it's context? (This seems to be the problem here)
particularly you just send an empty toSave to the "setAttributes" function

Unequal is written != and not !== (But it doesn't make a difference I guess)

Does "RM.OperationResult.OPERATION_OK" have a value due to it's context?
Because if it's undefined, it'll always compare to undefined


Pooja Srivastava selected this answer as the correct answer

0 votes

Comments

Jonus,

Thanks for responding. I defined waiverCount at the start of my script outside of any brackets.

You were absolutely right, my problem was toSave. I changed my code to this and it worked.

var item = new RM.ArtifactAttributes(ref);
item.values['VerifiedCount'] = waiverCount.toString();    
RM.Data.setAttributes(item, function(result){
             if(result.code != RM.OperationResult.OPERATION_OK) {
                            console.log("could not be saved", result);
             }
});

Instead of going through an array I directly passed in the Artifact Attribute ref.

Thanks again,

Pooja

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,926
× 7,485
× 1,698
× 383
× 382

Question asked: Mar 17 '15, 4:01 p.m.

Question was seen: 4,348 times

Last updated: Mar 19 '15, 2:14 p.m.

Related questions
Confirmation Cancel Confirm