Set the Customer Request Type through Automation

HH
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 19, 2018

When a customer submits a form the customer request type is set automatically. When I create the same form through the agent portal then the customer request type says "No Match." 

 

I've tried to fix this by setting up an Automation Rule that does this piece of JQL when the ticket is created: 

type != EMPTY AND "Customer Request Type" is EMPTY AND project = "My Project"

Then it edits the issue fields and set the customer request type to be the same as the issue type. 

 

Unfortunately it's not executing correctly and the log shows that the JQL statement passed successfully but it's failing on the edit issue: 

 

Error:

No fields or field values to edit for issues (could be due to some field values not existing in a given project):

 

Can someone spot what I'm doing wrong? 

 

Thanks!

 

3 answers

1 accepted

1 vote
Answer accepted
Steve Letch November 9, 2022

Update to the below:

If there's punctuation in the customer request type, sometimes it can fail, also if you want to make it accommodate name changes to the customer request type, use the internal DB name of the form, you can obtain that by querying the relavent db table OR by using a get customer request type value using jmwe.

 

Example of setting two insight fields and a customer request type:

{
    "fields": {
        "customfield_17700": [{
            "key": "SQ-349938"
        }],
        "customfield_17701": [{
            "key": "SQ-350003"
        }],
        "customfield_13704": "hd/8e4192e9-145c-4e9a-a2f3-260667324a49"
    }
}

 


If you have Automation for Jira, you can set the customer request type quite easily at the create stage using the following example

 

{ "fields": { "customfield_13704": "Office Management Request" } }

 

request.pngimage-2022-11-8_16-58-13.png

 

If you are creating tickets internally within Jira and want to ensure the customer request type gets set, then just add the customer request type to the internal create screen and make it mandatory.

Lee Burak May 11, 2023

Working!

Like Steve Letch likes this
0 votes
Davide March 28, 2019

Here's how I've managed to do this.

In the project, I created a new Custom Rule:

  • WHEN -> Issue Created
  • IF -> Issue Matches -> (advanced) "Customer Request Type" is EMPTY
    • in the same IF -> Issue Matches -> (advanced) issuetype = <a specific issue type>
  • THEN -> Edit Request Type -> <set the desired Request Type>

I add a separate IF - THEN pair for each issue type in the project, and under Options set it to "Run as the user who triggered the rule"

Kalyan Kumar Das December 2, 2019

Hi @Davide :

I am using Jira Core 8.2.3 and JIRA Service Desk 4.2.3 version.
Request Type is not a custom field.
So my question is how to handle these two field i.e. Customer Request Type and Request Type.

Kindly suggest.

Thanks,

Kalyan

 

 

Kalyan Kumar Das December 5, 2019

@Davide: Fixed the issue on my end.

Zita Bagi
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 11, 2020

How? We have Jira Core 8.5.3 and  JIRA Service Desk 4.5.3

rreddy April 15, 2021

@[deleted] 

 

I am using Cloud Instance, i tried to using the if else automation but it throws erroCRT pic 2.PNG

Like Miriam Hopton likes this
Hubert Kut
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 12, 2021

@rreddy Jira Service Management Cloud.

Here is how I managed to change request type in Issue Transition. You can trigger loop transition from automation to change request type


First you need to get a special request type value from db before you use postfunction. To do that:

1) Create a request in JSM with value of request type that you want to CHANGE INTO.
2)Create a postfunction on any transition (I used loop) to copy value from Request type into i.e Description
3) Use newly created transition and you should get sth like that in description
abc/d1sad1sd1-rt22-4123-ber2-3123a3wgy1
It's a value of request type from db
4) Now go back to your workflow. Remove postunction created in point 2 and add postfunction "update custom field" -> select "request type" -> paste value from point 3-> abc/d1sad1sd1-rt22-4123-ber2-3123a3wgy1 
That's it. Request type should change to one that you want during transition.

Cheers
Hubert

0 votes
PJ Wysota
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 19, 2018

1. Firstly - if You create a form through the portal - it should also assign CRT to the issue. However - if You create issue through JIRA backend - it won't (at least automatically).

If there are any issues with assigning CRT to issue for specific user - I would start with checking Permissions (that You are on Customers list, and have Customer - Portal Access permissions allowed)

2. CRT is quite specific Field Type... However in this case I assume it might be pretty simple:

a) in Portal settings make sure that Your CRTs matching JIRA Issue Types naming (I refer to your statement that you want CRTs to be matching Issue Types).

b) make sure that CRT you want to assign is matching Issue Type setup in Portal configuration

There is 1:1 mapping of CRTs into Issue Type - so in case You want automation to run - You need to ensure You follow the same mapping as it is set in the portal. If You miss anything - then You can add (duplicate) CRTs for other issue types, and not show them on the portal (do not add them to any groups)

Then it should work fine


HH
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 19, 2018

So I worked through your list thanks! Unfortunately none of that has helped, so I think I'm missing something! 

1. Checked permissions - I'm a global admin and I've even checked the permission helper to ensure that I do have full access to the project. 

 

2a. I'e checked that the naming is exact, going so far as to copy and paste one into the other just in case there was a random space or something like that! No luck. 

 

2b. I've gone to the issue types screen on the project and checked that it's there. I've also gone into the issue scheme and checked that the issue scheme does have the issue type associated with it. 

 

I must be missing something sorry!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events