You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

PHP Code Won't Update Incident

Received Response
13
Views
15
Comments
edited Feb 6, 2018 9:42AM in Customer Portal 15 comments

Content

So to make sure I wasn't losing my mind, I went and read http://documentation.custhelp.com/euf/assets/devdocs/may2017/Connect_PHP/Content/Connect for PHP API/RightNow Connect Object Model/Core/Incident.html

My code is below.

However, none of the incidents are updated. The output happens with the incident IDs showing, but they don't get updated.

Any reason why? I've seen posts mentioning the below but it doesn't appear in the link above. Adding the below doesn't help either.

 $inc->StatusWithType->Status = new RNCPHP\NamedIDOptList();

 

 

Code Snippet

             $res = RNCPHP\ROQL::query( "select ID from Incident where Incident.Queue.ID = 27 and Incident.StatusWithType.Status.ID=2 LIMIT 50")->next();
		while($i = $res->next()) {
			try {
				$incident = RNCPHP\Incident::fetch($i['ID']);
				$incident->StatusWithType->Status->ID = 103;
				$incident->save(RNCPHP\RNObject::SuppressAll);
				echo "Incident ID ".$i['ID']." Updated<br>";
			}
			catch ( \Exception $err ){
				echo "<p><b>Exception</b>: line ".__LINE__.": ".$err->getMessage()."</p>";
			}
		} 
        

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!