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

Adding Customer Request Type with workflow postfunctions

Valter Jakovlev February 8, 2021

Hello,

has anyone done this, and if no, how would you go about doing this. I know this is a specific field type and adding this via string will just not work.

I know that I would have to add this via request type ID, but how do I find that?

Customer request Type is a field that can not be configured like request types, but if an automated process creates the ticket, there is no way of viewing the ticket later on the portal, if the Customer Request Type is not set.

1 answer

1 accepted

0 votes
Answer accepted
Dirk Ronsmans
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 9, 2021

Hey @Valter Jakovlev ,

You can either get it by looking directly in the database or by running a small code snippet.

If you use this:

import com.atlassian.jira.component.ComponentAccessor

// get an issue that has the Request Type that you want to find the id for
def issue = ComponentAccessor.issueManager.getIssueByCurrentKey("SD-20365") //replace SD-20365 with a real ticket id
def cf = ComponentAccessor.customFieldManager.getCustomFieldObjectByName("Customer Request Type")
issue.getCustomFieldValue(cf)



/*
will return something like sd/f11719d8-a490-4948-97e8-d570f682aa15
use this id in the scripts
*/

 

it will output the request id of the issuekey you entered. So if you have an existing one you can trace the id back from that.

if you do have access to the database you can use the following too:

SELECT concat(lower(p.pkey),'/',vform.key) as value FROM jiraissue i , project p, issuetype t ,  AO_54307E_VIEWPORT vport, AO_54307E_VIEWPORTFORM vform WHERE p.id = i.project  AND i.issuetype = t.id AND i.project = vport.project_id AND vport.id = vform.viewport_id AND vform.issue_type_id = t.id AND i.id = 'PROJECT-123';

of course change the values in the query to match your project.

Valter Jakovlev February 9, 2021

@Dirk Ronsmans this worked! Thank you.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events