Setting request type in workflow post function

Brad Mace [ATS] October 4, 2016

How can I set the request type as part of a workflow transition?

3 answers

1 accepted

2 votes
Answer accepted
Derrick Robinson January 27, 2020

I've had some Very helpful feedback from Simon Kleist of 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

Rajkiran January 28, 2020

@Derrick_Robinson Thanks for sharing this info.

1 vote
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 4, 2016

You can't - a different type might mean a change of issue type, and a change of issue type potentially needs to go through the whole "move" process.

Brad Mace [ATS] October 4, 2016

I'd understand if it rejected types that would require a move, but it seems like I should be able to select among the request types that fit with the issue type i'm creating/updating.

Rajkiran January 8, 2020

@Brad Mace [ATS] 
I am looking at the exact same thing.
Did you figure out how to do that?

Derrick Robinson January 23, 2020

+1

I've been struggling with this for weeks.

I have 6 Request Types under the 'parent' Issue Type.

I change the Issue type (from the default: IT - Support) in an earlier transition (which works fine), but in doing so it removes the previous default 'Request Type: Emailed Request' to: 'None'. I understand that, since the new Issue Type is what I want: 'Development', but whatever way I try I simply can't (later) change the Request Type to the relevant value (which is, again, a valid 'child' of the 'parent' Issue Type).

I've been trying to use the Atlassian built-in 'Update custom issue field' post-function to set the required value, but it simply won't do it.

I'm wondering why is 'Request Type' an option in the Atlassian built-in 'Update custom issue field' post-function, if it doesn't work? Looks like it's wasting a lot of people's time??

Would appreciate someone from Atlassin answering (my own support request) or this thread.

Like Arto Kovalainen likes this
0 votes
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