How to auto-assign issue using mapping

Hi there,

Perhaps I miss something but haven't found solution so far...

we need to automatically auto-assign issue right after its creation to a dynamically chosen user on the base of reporter.

To choose the assignee some mapping is needed. Every reporter has some default assignee independently in which project/component issue is created.

For example

User1 -> Assignee1

User2 -> Assignee1

User3 -> Assignee2

User4 -> Assignee2

User5 -> Assignee3

and so on...

Perhaps it could be done on the base of user properties but I have no clear idea or solution to this problem. Could you please help me? :)


2 answers

1 vote
Henning Tietgens Community Champion Mar 05, 2013

You can use the Script Runner plugin to script a postfunction, where you map the reporter to the assignee.

we came back to the subject after a while and one more condition appeared... we need to get some hints for determining default assignee using external oracle datasource... i haven't found a solution on how to access external DB using script runner so far... any help would be appreciated :)

Henning Tietgens Community Champion Apr 02, 2013

Using something like this you can access an external database:

Sql sql = null

try {
	// Get Context to connect to DATABASE as a datasource
	Context ctx = new InitialContext()
	if (ctx == null) throw new Exception("No Context found!")
	DataSource ds = (DataSource) ctx.lookup("java:comp/env/jdbc/DATABASE")
	if (ds != null) {
		sql = new Sql(ds)
		sql.eachRow(sqlStatement) { row ->
			// ...
} catch (Exception e) {

The datasource DATABASE has to be defined within <Context> section of context.xml in jira/conf similar to something like this:

&lt;Resource name="jdbc/DATABASE" auth="Container" type="javax.sql.DataSource"

After changing context.xml you have to restart JIRA. And you have to use driver matching the database system used.


using post function you can do this

but i need to script it somehow right?

no, just you need to configure postfunction at create transition step

ok this step is simple... but how can i freele choose assignee on the base of different reporters there? it'c completely customized behavior. i don't want to choose assignee from the list, because it depends on reporter - as i wrote in teh first post.

develop your own custmized postfunction, then add condition based on reporter and assign to the default assignee of the reporter

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 27, 2018 in Portfolio for Jira

Introducing a new planning experience in Portfolio for Jira (Server/DC)

In the past, Portfolio for Jira required a high degree of detail–foresight that was unrealistic for many businesses to   have–in   order to produce a reliable long-term roadmap. We're tur...

2,637 views 18 21
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you