Home Self-Service Portal - Community
image IT Monkey:   


Formal Cireson Support (phone, email, and web) is not included with the free Self-Service Portal – Community app. For trouble shooting assistance, take advantage of the Cireson Community to find answers to your questions. However, if you’d like to purchase a Support Package to access more formal Cireson Support (phone, email, and web), please contact us today to learn more on the pricing options.

Change status on File Attachment for End users

Hello,

Is it possible to change status of a request when the file is uploaded. I have the below given scenario:

Let's say request is in XYZ status. Whenever user uploads any file, the status remains XYZ. My requirement is when the file is uploaded, status of the request should be changed to Active.

Thanks in Advance,

Manas Gautam

Answers

  • Justin_WorkmanJustin_Workman Cireson Support Super IT Monkey ✭✭✭✭✭

    This is a great idea! Here's a bit of js you can add to custom.js that will accomplish what you are after:


    app.custom.formTasks.add('Incident', null, function (formObj, viewModel) { 

    if (_.has(viewModel, 'FileAttachment')) {

    viewModel.FileAttachment.bind('change', function(evt){

    if (evt.action === 'add' && viewModel.Status.Id !== '5e2d3932-ca6d-1515-7310-6f58584df73e') {

    var status = {

    Id: "5e2d3932-ca6d-1515-7310-6f58584df73e",

    Name: "Active"

    };

    viewModel.set('Status', status);

    }

    });

    }

    });

  • Manas_GautamManas_Gautam Customer IT Monkey ✭

    Hello Justin,

    Thanks for your response.

    This code works fine but there's an issue. If the user is attaching the file for the first time, this block of code does not get executed. It works only when there is at least one existing attached file and second(or more) file is being attached.

    Regards,

    Manas

  • Justin_WorkmanJustin_Workman Cireson Support Super IT Monkey ✭✭✭✭✭

    @Manas_Gautam - I have just tested with an incident with no attachments but in a status other than active. As soon as I added the attachment, the status changed to active. Is it possible your tests where with an incident that was already in active status?

  • Manas_GautamManas_Gautam Customer IT Monkey ✭
    edited October 29

    @Justin_Workman Yes, I checked again. The incident on which I am testing this code is not in Active status. The same issue still persists. On first attachment status is not changing to Active. The ticket is in custom status input of waiting reply from end user.

  • Manas_GautamManas_Gautam Customer IT Monkey ✭

    @Justin_Workman Is there any modification in code or any other approach you can recommend?

    Regards,

    Manas

Sign In or Register to comment.