Set Request Type in Customer Portal

Issue #675 resolved
Weston Rossborough created an issue

Hi Fidel,

I would like to use a post function to set the Request Type in the customer portal of my project. If this is possible, how would I go about doing this?

The use case here is I have a CSV that I'm going to import to create new issues within this project, when the issue is created I would like it to have a Request Type assigned as if it was created in the customer portal.

In this use case I would like the request type to be set to "Request Time Off".

Attached is a screenshot of current post functions in the Create transition.

PostFunction.jpg

Thanks,

Weston

Comments (7)

  1. Fidel Castro Armario repo owner

    Hi @WestonR,

    You can use "Copy a parsed text to a field" post-function for setting "Request type" with the following configuration:

    • Target field: Request type
    • Parsing mode: basic
    • Text to be parsed: the key of request type "Request Time Off"

    The key of a particular request type can be obtained using "Copy a parsed text to a field" post-function for writing the value of field Request type in an issue whose request type is the one whose key we want to obtain. We can use New comment as target field, and we will obtain the key of the desired request type in an automatic comment created in the issue.

    Please, let me know if you have any doubt.

  2. Weston Rossborough reporter

    Hi Fidel,

    Thanks for responding! I tried the steps you recommended, but it doesn't seem to work. I've attached a screenshot of the post function for your review. Could it be in the wrong order?

    I should also mention that I didn't see "Request Type" as an available field when setting the post function, however I did see "Customer Request Type" as an available option. Could this be the issue?

    Thanks,

    Weston

  3. Weston Rossborough reporter

    Fidel, I created a test ticket from the customer portal and I received this error.

    RequestTypeError.jpg

    I removed the post function that was added and the issue went away. When I recreated the post function the issue returned.

    Thanks,

    Weston

  4. Fidel Castro Armario repo owner

    Hi @WestonR,

    Yes, you should use "Customer Request Type".

    The problem is that you are using the request type's name as value for setting the field, but you should use the request type's key instead.

    Unfortunately, there isn't a direct method to find out the key. In order to obtain the key of a particular request type you should use "Copy a parsed text to a field" post-function for writing the value of field Customer Request type in an issue whose request type is the one whose key we want to obtain.

    You can use New comment as target field, and you will obtain the key of the desired request type in an automatic comment created in the issue.

  5. Weston Rossborough reporter

    Hi Fidel,

    I tried this out and it worked! I was originally using a post function to copy a value to a hidden field, then used an automation rule to set the request type based on that field value. This works much better though!

    I'll mark this issue as resolved. As always, thanks for your help!

    Thanks,

    Weston

  6. Log in to comment