Highlighted
Absent Member.. Absent Member..
Absent Member..
404 views

Only One related Problem for one incident!

Hi,

 

Is it possible to Limit the no. of related problems for an incident to one?

or a user should not be able to raise/ relate more than one problem for an incident?

 

Do share your ideas.

 

 

TH@nks
dev
0 Likes
4 Replies
Highlighted
Absent Member.
Absent Member.

Hi,

Yes it is possible and you have to customize your environment slightly for the same.

-- You can disable the display option "Related>Problems>Associate" in case already a problem is related.
For same you could write a small JS which will check for problem related record for existing incident(using screlation table) and will return false/true accordingly.And then you could add the condition this display option as ,
< existing condition> and jscall("Check_relatedPM.check", number in $L.filed)

here Check_relatedPM is name of JS, check is function to call which return true or false (in case related record found)

Same things you have to apply on "Related>Incidents>Associate" DO of problem record having DS (rca.view) so that incident can not be related from problem.

-- other is you can use the same JS in process records mapped to display action of above Display option to restrict the association.


hth,
____________________________________
Assign Kudo, if found post useful and mark it accepted if solves the issue.
Highlighted
Absent Member.. Absent Member..
Absent Member..

Hi Piku,

Thanks a lot for the insight!
Can u plz throw some light on the JS to use as well?
TH@nks
dev
0 Likes
Highlighted
Absent Member.
Absent Member.

Try like below,


function check(number)
{
var screlfile = new SCFile('screlation');
var querysc = "source = \"" + number + "\" and source.filename=\"problem\" and depend.filename=\"rootcause\"";
var scfileselect = screlfile.doSelect(querysc);
if (scfileselect == RC_SUCCESS)
{
print("You can not relate more than one Incident to same problem record.");
return false}
else
{ return true}

}


hth,
____________________________________
Assign Kudo, if found post useful and mark it accepted if solves the issue.
Highlighted
Absent Member.. Absent Member..
Absent Member..

Nice! It worked..
thanks a lot!!
TH@nks
dev
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.