Service Desk Practitioners Forum
cancel
Showing results for 
Search instead for 
Did you mean: 

Attachment; Attachment Exists with wrong value

Highlighted
fgssl2
Regular Collector

Attachment; Attachment Exists with wrong value

Service Desk 4.5 SP16

I have Service Pages customized to insert attachments when opening or updating a service call.

I also have a database rule that sends a confirmation e-mail according to some conditions.. The thing is that the confirmation e-mail has the Attachment; Attachment Exists on its body text and it returns "no" for all the tickets opened via service pages. For all of the rest (sd client, inbound e-mail) it returns "yes".

When inserting service calls through service pages it should return "yes" too.. can you help me out?

Thanks.
8 REPLIES
Mike Bush
Honored Contributor

Re: Attachment; Attachment Exists with wrong value

I've not tried to customise the SP for attachments, are you sure that you SET the "attachent exists" field when you did it?
fgssl2
Regular Collector

Re: Attachment; Attachment Exists with wrong value

Yes I'm sure..

It's in this part of the code of the CreateServiceCall.jsp file:

// The boolean AttachmentExists of the parent is not automatically updated. So it should be updated when it is still false.

if (!att.getAttachmentExists().booleanValue()) {
att.setAttachmentExists(new Boolean(true));
att.transfer();
fgssl2
Regular Collector

Re: Attachment; Attachment Exists with wrong value

Yes I'm sure..

It's in this part of the code of the CreateServiceCall.jsp file:

// The boolean AttachmentExists of the parent is not automatically updated. So it should be updated when it is still false.

if (!att.getAttachmentExists().booleanValue()) {
att.setAttachmentExists(new Boolean(true));
att.transfer();

Thanks
Mike Bush
Honored Contributor

Re: Attachment; Attachment Exists with wrong value

Well - clutching at straws - do these lines appear BEFORE the SAVE() for the Service Call?
fgssl2
Regular Collector

Re: Attachment; Attachment Exists with wrong value

Before the save... here you go:

if (!att.getAttachmentExists().booleanValue())
{ att.setAttachmentExists(new Boolean(true)); att.transfer();
}//closes the if
}//closes the for
sc.save();

Thanks
Mike Bush
Honored Contributor

Re: Attachment; Attachment Exists with wrong value

Well - I'm not sure how valid this test is but here goes. I took the OOTB SP17 CreateServiceCall.jsp and added JUST a GET for the IAttachment and a SET of the boolean AttachmentExists. (ie I haven't ACTUALLY attached anything!). I had to amend your code to test for NULL, thus

IAttachment att = sc.getAttachment();
if (att.getAttachmentExists()==null || att.getAttachmentExists().booleanValue())
{ att.setAttachmentExists(new Boolean(true)); att.transfer();
}

I hope this may be the clue you need. This ended up with the flag set (but lying in the opposite way to yours!

M
fgssl2
Regular Collector

Re: Attachment; Attachment Exists with wrong value

Hello,

Sorry I took so long to reply. I was finally able to try that piece of code and it still does not work..

Do you have any other suggestion?

Thanks in advance..
fgssl2
Regular Collector

Re: Attachment; Attachment Exists with wrong value

It turned out that I checked the values of the SER_ATTACHMENT_EXISTS column and they are correct. The service calls I create through service pages have the value "1" on that column, just like the ones I create normally on the JAVA GUI. I have a db rule that sends a confirmation email to the caller when a service call is created that contains some information.. One of wich is the existence of an attachment. When creating service calls with attachments through the JAVA GUI the value is fine.. When creating through service pages it tells me that there is no attachment!

Where does the [Attachment; Attachment Exists] variable get its value?? In the SER_ATTACHMENT_EXISTS column of the service call table, right??

Thanks in advance.
//Add this to "OnDomLoad" event