New Ranks & Badges For The Community!
Notice something different? The ranks and associated badges have gone "Star Fleet". See what they all mean HERE
Highlighted
Absent Member.. Absent Member..
Absent Member..
1065 views

Validation for attachments

Hello,

           I need to trigger a validation message(mandatory) for an attachment whenever a problem ticket is raised. Can anyone help me on this requirement.

Tags (1)
0 Likes
7 Replies
Highlighted
Fleet Admiral Fleet Admiral
Fleet Admiral

Hello,

Still not sure how it can be done, but the description of the requirement is not understandable.

You need to run the validation (what validation? every problem ticket must have attachment?) if after openening of the Problem ticket (not Incident) there was an attachment in it?

0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Hi Vadim,

                   The requirement is whenever i try to open a new problem ticket or try to raise an linked problem ticket from an incident, it should be opened with an attachment. If the operator fails to do that, a validation message should be fired that attachment is mandatory.

0 Likes
Highlighted
Fleet Admiral
Fleet Admiral

Hi SM9,

 

OK.

 

Direct field is not available for attachments so validations like FC and others do not work here.

 

Attachments are stored in SYSATTACHMENTS table, with columns application and topic. Application stores application name and topic stores ID for application.

 

So add trigger on table rootcause with

 

type - 2 after add

 

script is as follows-

 

var attachments = new SCFile("SYSATTACHMENTS");


var RC = attachments.doSelect("topic=\""+ ID +"\"");

if(RC == RC_SUCCESS) {

   print("Attachments are present for the given ID");
  
  }
 
  else {
 
   print("Attachemnts are not present kindly attach the proper file");
 
  }

 

 

 

 

we are using after add as attachements are attached only when ID is assigned to ticket.

 

Drawback is it shows only message but do not restrict user to adding from ticket means Problem ticket iscreated even if you do not add Attachements.

 

Re,

abhijit

 

0 Likes
Highlighted
Fleet Admiral Fleet Admiral
Fleet Admiral

Something same can be done with Queries and validation in format control but still there will be probs with calling the validation before adding the record.

0 Likes
Highlighted
Fleet Admiral
Fleet Admiral

Hi ,

 

 

Corrected script is as follows:

 

 

 

var ID = system.vars.$L_file.id;

//print("\n The value of Id is nothing but:"+ ID);


var attachments = new SCFile("SYSATTACHMENTS");


var RC = attachments.doSelect("topic=\""+ ID +"\"");

if(RC == RC_SUCCESS) {

   print("Attachments are present for the given ID");
  
  }
 
  else {
 
   print("Attachemnts are not present kindly attach the proper file");
 
  }

 

 

re

abhijit

0 Likes
Highlighted
Absent Member.
Absent Member.

Hi SM9,

Yes Vadim is right .
If you are using Delay assign problem ID for Problem management then I suppose it would not be possible to check the attachments.Because first record id need to be generated only then validation could be run.
But can try at-least for abhijit solution.

regards,
____________________________________
Assign Kudo, if found post useful and mark it accepted if solves the issue.
0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

As attachments are added as part of the saving of the record being updated by the binaries, there is no way BEFORE saving the record to test this. And for update the same thing: If you have a validation for attachments, it will correctly identify if not attachment exists BEFORE the current update - but the one added WITH the update is no checked.

So: This validation cannot be implemented in a way to prevent the incident being added/updated.

What you might want to do is to add a post process that pops up with a format that allows attaching a file with another update automatically. So each user will be required to add a file. However, the user could actively ignore this one.

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.