Quantcast
Viewing all articles
Browse latest Browse all 2504

Trying to create an Incident with a "Root Cause" disposition (1 Comment)

Topic by csmith

Content

I am trying to create an incident with a "Root Cause" which I think is the Disposition field, I have the following Code:
-------------------------------------------------------------
use RightNow\Connect\v1_1 as RNCPHP;
require_once( get_cfg_var("doc_root")."/ConnectPHP/Connect_init.php" );

$incident = new RNCPHP\Incident();
$meta = RNCPHP\Incident::getMetadata();

$incident->Subject = "SaaS System Down";
$queryResult = RNCPHP\ROQL::queryObject("SELECT Contact FROM Contact WHERE id=".$this->session->getProfileData('c_id'))->next();
$incident->PrimaryContact = $queryResult->next();

$incident->CustomFields->priority = 193; //S1-Mission Critical
$incident->CustomFields->issue_type = 37; //Technical
$incident->Queue->ID = 14; //Technical Services - Urgent

$incident->Disposition->ID = 1486; //SaaS Admin

$incident->Threads = new RNCPHP\ThreadArray();
$incident->Threads[0] = new RNCPHP\Thread();
$incident->Threads[0]->EntryType = new RNCPHP\NamedIDOptList();
$incident->Threads[0]->EntryType->ID = 3; // Used the ID here. See the Thread object for definition
$incident->Threads[0]->Text = "Sample.";

$incident->save();

---------------------------------------------------------------
When it executes I get:

Fatal error: Uncaught exception 'RightNow\Connect\v1_1\ConnectAPIError' with message 'Not Allowed: read-only: ServiceDisposition.ID'

Now I have found that I can successfully create an Incident by doing the following:

 

$queryResult = RNCPHP\ROQL::queryObject("SELECT ServiceDisposition FROM ServiceDisposition WHERE id=1486")->next();
$incident->Disposition = $queryResult->next(); //SaaS Admin
 
But if I know the Id is static, I don't want to have to perform queries, this seems expensive just to set the value, I've looked through all the docs, but they never show "setting" the value of a NamedID Hierarchy.  
 
Also we are using RightNow CX version "November 2011"

Version

November 2011

Viewing all articles
Browse latest Browse all 2504

Trending Articles