Menu

changing tickets notations.

soopal
2011-01-26
2012-12-19
  • soopal

    soopal - 2011-01-26

    Hi all; we need to change the P/I/R-#merial sequence to let our itop installation  go to producction.
    So when an user make user-request instead R-00000X must be OT-0000. on incident request the I-000 must be HSS-AV-0000X
    and so on.
    Will this customization means a lot of rewrite? It must be done at OQL level or through the stack level -> BD, PHP?
    How to safely make this one?

    Thanks a lot!

     
  • Denis

    Denis - 2011-01-27

    The computation of the ticket name is done in PHP. Search for the method called "ComputeValues" of the corresponding class.

    For example, for Incident tickets, the method is defined in modules/itop-incident-mgmt-1.0.0/model-incident-mgmt.php, at line 53:

        public function ComputeValues()
        {
            $sCurrRef = $this->Get('ref');
            if (strlen($sCurrRef) == 0)
            {
                $iKey = $this->GetKey();
                if ($iKey < 0)
                {
                    // Object not yet in the Database
                    $iKey = MetaModel::GetNextKey(get_class($this));
                }
                $sName = sprintf('I-%06d', $iKey);
                $this->Set('ref', $sName);
            }
            return parent::ComputeValues();
        }
    

    You can change the pattern of the name to 'HSS-AV-00000X' as follows:

        public function ComputeValues()
        {
            $sCurrRef = $this->Get('ref');
            if (strlen($sCurrRef) == 0)
            {
                $iKey = $this->GetKey();
                if ($iKey < 0)
                {
                    // Object not yet in the Database
                    $iKey = MetaModel::GetNextKey(get_class($this));
                }
                $sName = sprintf('HSS-AV-%06d', $iKey);
                $this->Set('ref', $sName);
            }
            return parent::ComputeValues();
        }
    

    The only concern about this customization is that you'll have to re-apply/patch it the next time you upgrade iTop. We should probably move the pattern definition into the configuration file, so that every installation can choose their preferred pattern. I've created the enhancement request #349 in Trac for this.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.