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

How to automatically add project key and issue type to Customer Request Type custom field ? Edited



I need a bit of help please.


I have discovered that for JIRA (6.4.8) + Servicedesk (2.5), in order to display an issue on the ServiceDesk customer portal, one of the (many) requirements is that the 'Customer Request Type' custom field is set to a string that looks like "<project key>/<Servicedesk portal issue type>".


i have been trying to create a ScriptRunner EscalationService on the "Issue Created"  event, based on the article, but it does not work.


I also attempted to go the workflow way ( but i can't get it to work due to the error below:


2017-04-06 11:38:35,410 http-bio-8080-exec-1 WARN g.moscalu 698x4655x1 1ybrlfj /secure/QuickCreateIssue.jspa [internal.customfields.origin.VpOriginManagerImpl] Origin portal not found for 'DEMO/incident'.

Config info: we have one project per customer and a servicedesk activated per each external project (we have a couple of internal projects). All our projects and ServiceDesks are configured the same (SQL to create the portals, views, mappings, etc - obtained by reverse engineering what the portal does).


So my need is to add the possibility that new tickets that are external get displayed on the portals, as if they would have been created from the portal. The old ones - we'll update them via bulk changes, but we can't do this every single day.


Our agents use the JIRA interface, while customers are being moved on the portal, so I kind of absolutely need to get this working.


Available addons: 

- ScriptRunner

- JIRA Misc Workflow extensions

- JIRA Suite Utilities

Thanks in advance,



[LE]: sample data:

SELECT id FROM project where pkey="DEMO";



SELECT id,issuenum,issuetype,reporter,summary FROM jiraissue where project=11701 order by created desc limit 5

ID issuenum issuetype REPORTER SUMMARY
40507 57 11100 g.moscalu Internal attachments for DEMO-56
40506 56 10306 g.moscalu new test
40504 54 10306 g.moscalu test #3
40505 55 11100 g.moscalu Internal attachments for DEMO-54
40502 52 10306 g.moscalu test 2

 and the portal mapping:

SELECT * FROM customfieldvalue where customfield=10000 and issue in (40502,40504,40505,40506,40507) order by id desc limit 5

639642 40504 10000 null demo/incident null null null null


The current workflow post function is the next one:

import com.atlassian.jira.component.ComponentAccessor 

def customFieldManager = ComponentAccessor.getCustomFieldManager()

def project = issue.getProjectObject()

def userCf = customFieldManager.getCustomFieldObjectByName("Customer Request Type")
issue.setCustomFieldValue(userCf, project.getKey().toLowerCase() + "/incident") 

failing with:

2017-04-06 17:01:55,611 http-bio-8080-exec-3 WARN g.moscalu 1021x6970x1 88np8g /secure/QuickCreateIssue.jspa [internal.customfields.origin.VpOriginManagerImpl] Origin portal not found for 'wirefr/incident'.

while in DB, I have the following issues that should be accesible by the customers (external tickets):

pkey pname STRINGVALUE CRs IRs SRs INCs INTs NbIssues
WIREFR WIREFRANCE null 27 53 36 864 107 1094
WIREFR WIREFRANCE WIREFR/incident 0 0 0 1 0 1


3 answers

1 accepted

the final solution was to create an automation rule that handles tickets as they get created or updated and sets the proper request type... i even went further and the rule is created via REST API  calls :) (download servicedesk definitions, then look a couple of things up in the JSON with "jq" tool, and build the proper JSON to create the rule - all our sdesk projects are 99,99% similar)


of course existing issues had to be updated via bulk updates per project & issue type....

for some reason, on some tickets the project code is in caps, on other project tickets, the project key is lowercase... i cannot understand why, so i can set a proper workflow code

Hi Gabriel,

I've the same issue with "request type". I've found also not solution until yet. I tried REST-API and .NET-SDK. I create also a support ticket at jira-support, but got basically the answer "we provide REST-API / .NET, but we do not support creating issues from external systems."

I know: not the answer you are looking for.

BR, Andre

Thanks Andre,


I just wonder if anyone can put some light on how the project key on servicedesk portal get on upper or lower case... or how shall I do to make it the same for all our 200+ customer projects, to be able then to force this via the workflow post-function...

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Jira Core

How to manage many similar workflows?

I have multiple projects that use variations of the same base workflow. The variations depend on the requirements of the project or issue type. The variations mostly come in the form of new statuses ...

3,090 views 11 5
Join discussion

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