Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Automate Request Type change upon Issue Type change

Derrick Robinson January 15, 2020

Hi,

I've just rolled out Jira Service Desk within our organisation and have found another problem that I can't work out how to resolve.

Specifically, I want to automatically change the Request Type when an Issue Type is changed.

I'm using:

  1. 'Jira Misc Workflow Extensions' (JMWE) to automatically create a linked issue for when we need to send a Jira Service Desk ticket to our Development team.

  2. 'Extension for Jira Service Desk Cloud' to allow the Linked Issue (link) to be seen in the Jira Service Desk customer Portal, so our colleagues can see when their issue has been sent to another department, and hence have visibility of the linked issue.

However, although I can change to the correct linked Issue Type using JMWE, in doing so it clears the Request Type, which then doesn't allow the Linked Issue (link) to be seen in the customer portal.

At the moment I'm having to ask our support guys to manually update the Request Type as a workaround.

I've looked into using JMWE and 'Automation for Jira', but neither seem to be able to do what I need:

  1. JMWE - doesn't allow the Request Type to be set (in a post function automation) - it just isn't available in the dropdown.
  2. 'Automation for Jira' - feeds back a warning:

"Sorry, but changing the Customer Request Type is currently not possible, since Jira Service Desk does not provide an API for this":

Annotation 2020-01-15 143213.png

I'd really appreciate any help to automate changing the Request Type.

Thanks.

 

4 answers

1 accepted

8 votes
Answer accepted
Derrick Robinson January 27, 2020

I've had some Very helpful feedback from Simon Dleist Atlassian who's informed me that:

I've been testing changing the request type using a post function, and as you say, it doesn't work when given either the name or the ID of the request type.
I found out that you have to enter the request type exactly as it is saved in the Jira database, which, for my service desk project with the key CSD is a string like "csd/technicalsupport" for the "Technical Support" request type.

Since you are on a cloud instance, you don't have direct access to the database, so you can't look up the request types in there.

I can extract a list of all the request types from your site's database and send it to you.
In order for me to access your site's database, I need your consent through the ticket.
If you consent, please open the ticket using the link below and click the "Approve data access" button.

I'm following up internally to find a way to improve this, as I can see that it's not very intuitive or clear at the moment.


In a nutshell, the problem is due to setting the Request Type exactly as it’s stored in the database (and not the ‘label’ cloud users see).

For my Request Type of 'Development' that equates to:

isd/57127acb-fdb1-7084-b422-6c2f43051524

Since Cloud users are unable to access the database to get at these values, I had to authorise Simon to hop on to our instance so that he could extract my Request Types.

Simon then sent me an extract from the database of my various request types as stored in the cloud database and... success!

Simon’s also raised this issue and has a meeting scheduled today to follow up on this internally!

Having now received these, I’ve added them to my workflows and initial tests have been successful. However, since the system is now live I can’t do further testing until this evening. But it’s looking promising!

Thought you’d like to know, as I think it’ll help quite a few people out.

Cheers,

Derrick

Daniel Triftshaeuser May 12, 2021

Hello Derrick,

there is an option for you to acquire this value yourself.

We did this by including the "Copy value from other Field" post-function and copied request type to description.

2021-05-12_11h44_17.png

This way the value is easily extractable, even for cloud users.

2021-05-12_11h45_44.png

Best Regards

Dan

Like # people like this
Alex Steinlauf August 26, 2021

@Daniel Triftshaeuser you are a legend.

Like # people like this
Tiele Declercq August 27, 2021

This is not working for me.

I cannot select Request Type as a field to copy from.

So I tried advanced setting using json and tried:

0:{{issue.Request Type}}
1:{{issue.Request Type.requestType.name}}
2:{{issue.Request Type.requestType.id}}
3:{{issue.customfield_10042}}

Which results in:

0:Request service
1:Request service
2:21
3:Request service

So not the same format as @Daniel Triftshaeuser but I did manage to get an 'ID' here.

But when trying to 'set' my fields..  Tried:

"Request Type": 21
"Request Type": "Request service"
"customfield_10042": 21
"customfield_10042": "Request service"

But in every event, the Request Type turned empty.

Anything else I can try?

Daniel Triftshaeuser August 30, 2021

Hey @Tiele Declercq 

 

the request ID can be used for advanced compare conditions (regex) but it is not exactly what you are looking for here.

 

You are trying to extract via automation, this is not possible afaik.

I used a POST-FUNCTION meaning a workflow function. To make this easy to execute I created a looping transition from any status -> itself.

Check the first screenshot I posted again.

 

BR
Dan

Tiele Declercq September 1, 2021

Dan,

Atlassian Support has confirmed your statement. It's currently not possible to 'set' this value in the Automation. It should be possible within the deprecated Legacy Automation tho (have not tried this).

An update should be coming out 'shortly' that enables this.

Tiele

3 votes
Davis Truong November 6, 2022

I just found an easier way to do this without having to open a ticket to get DB information.  Steps are below. 

1. Find out what is your custom filed ID for "Request Type"

  • Go to Custom Fields, and locate "Request Type" field. 

image.png

  • Click on the ... at the right hand side and chose "View Field Information" image.png
  • At the top of your address bar Look for "customFieldID=#####" the # is the number of your custom field. image.png in my case my "Request Type" Custom field is 10010

2. You will now need to know the ID number of your "Request Type". To do that, do the following. 

  • Go to your JSM project's "Request Types".  image.png
  • Locate the Request Type you want. In my case I created one called "BeyondTrust"image.png 
  • Click on your request type. In my case, just click on "BeyondTrust" image.png
  • A new page will load, this is where you get to modify the form of your request type. 
  • At the top of your address bar, look for request-type/###/request-form. The ### is the number for your "Request Type". You will need this for a custom action. 
  • In my case, my "Request Type" number is 268. You will need this number for later. 

image.png

 

3. Go back to your automation.  For my case, I wanted to update the "Request Type" based on an issue type that was created. My requirement is that, if an issue type is "BeyondTrust", update the "Request Type" filed to "BeyondTrust". 

  • In my case since i am modifying an existing automation rule. I created an If: all match match. 
    image.png
  • You will want to creat an action to Edit the filed: Instead of picking any field, click on "More Options" and add the following string. image.png
  • Replace the customfield_### , and Requst Type ### with your own number. 

    {
    "fields": {
    "customfield_10010": "268"
    }
    }

 

 

 

This was a quick edit and worked well for me. 

Muhammad Akram Sharifi December 15, 2023

Thank you this worked for me. 

Like Davis Truong likes this
0 votes
Philipp Schenke August 23, 2022

Hi everyone.

Don´t know if anyone is struggling about this problem anymore. I had also weird automation errors when I wanted to change the Request Type upon issue type change.

After searching a little bit I found this feature request from Atlassian. This is a solution for the cloud versions. 2 days ago they have launched a new feature in the "Feature Labs" section of the project.

I tested this an it works good for us. You can find more information on how to use this in the feature request.

Maybe someone else of you are happy to have this feature.

 

Cheers

Philipp

0 votes
Petter Gonçalves
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 16, 2020

Hello Derrick,

Thank you for reaching out.

Indeed, the ability to automatically update the request type when changing the issue type of a ticket is still missing in Jira Service Desk.

We completely understand how impactful this lack is for some customers, and that's why we created the following feature request to implement this functionality:

Update request type upon issue type change 

Feel free to vote and watch the suggestion to increase its priority and also receive notifications about any updates.

For now, I believe the apps you are using cannot provide a viable workaround since JIRA Service Desk does not provide the API to change Request types, however, I was able to find an achievable workaround using Jira Service desk default automation.

The only limitation on that workaround is that you will need to restrict your issue type to only be changed upon a status change. You can achieve this by using a separate workflow for each issue type in your site, forcing the users to click on "Move" to change the issue type of the issues. Once you do it, these would the steps to configure the automation:

  1. Go to project settings > Automations
  2. Click Add Rule > Create a Custom Rule
  3. Set as below:
    1. Trigger: Status Changed
    2. Conditions:  Create a single condition to set the request type for each issue type value:
      Issue Matches > issuetype="1" and "Customer Request Type" is EMPTY
    3. Actions:  Edit Request Type > Select the request type you would like to set when issue type is set to the issue
  4. Then, Save it.

Let us know if you have any questions.

Derrick Robinson January 20, 2020

Thanks Petter,

Unfortunately, part of the problem has been in my understanding, but thankfully I had a eureka moment yesterday evening when I realised where I was going wrong: basically, I was trying to set the Request Type when I was creating the linked issue and didn't appreciate that the fields I was setting are actually applicable to the new linked issue being created and not the original issue. Now I've got over that hurdle I can focus on the more specific issue of automatically setting the request type of the original issue, after I've changed its Issue type.

I've therefore just implemented your solution and will see how that goes.

Really appreciate your help.

All the best,

Derrick

Petter Gonçalves
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 20, 2020

Thank you for sharing this information, Derrick.

Please, let us know in case you face any questions while performing the suggested steps.

Andrey Kolesnikov April 22, 2020

@Petter Gonçalves that doesnt work, because when i try to add action "Edit request type" it says me "Automation will only change the request type if the issue type won't be changed"

André Bunte June 18, 2020

@Petter Gonçalveswe need the same functionallity to change request type when an issue in Jira Service Desk is created via Jira to notify added participants.

I tried to create an automation rule in different ways:

1. with action "Edit request type" (as descripted here: https://confluence.atlassian.com/jirakb/customer-request-type-displays-no-match-in-jira-core-or-software-859463969.html 
result: I couldn´t find this action type in automation

2. with action "Edit issue" and additional fields (JSON)
result: (invalid value of Customer Requstest type (customfield_10500))

So, until now, I was not able to do it.

Maybe you can help me.

Nathan Given November 10, 2020

I ran into a similar problem when creating new issues.  The only way aruond it was to not use the new automation rules but instead use the old/legacy automation:



Like # people like this
Nasim Chowdhury February 17, 2021

@Nathan Given  Were you successful in setting up the "Request Type" and If you use the legacy automation rule with the trigger being "Issue created" will you not going to run out of automation limit. I think every time the automation rule triggers (in your case every time an issue is created) , count as an execution.

Nathan Given February 17, 2021

@Nasim Chowdhury ,

 

I later found that the newer automation has a "Create service request" action:

 

This doesn't count against our API limit because it is tied to a single project ("Single-project rule executions do not count towards your usage. A single-project rule is a rule that automates a task or process that only affects one project")  https://support.atlassian.com/jira-software-cloud/docs/how-is-my-usage-calculated/

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

Here is how I managed to change request type in Issue Transition.

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events