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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Adding Customer Request Type with workflow postfunctions

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 Feb 09, 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.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira Service Management

Why upgrade to Jira Service Management Premium?

We often have questions from folks using Jira Service Management about the benefits to using Premium. Check out this video to learn how you can unlock even more value in our Premium plan.  &nb...

227 views 1 6
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you