The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How create a scripted field that shows language depending of project in CREATING ISSUE screen

jmsantam
February 6, 2013

I want to show a language field that is a selector of language.

the values of the selector shall change depending of Project or UserGroup ( or whatever )

I am using JIRA 5.1.4

I am using script runner to create a scripted field "language"

question is :

has to be done in Groovy, Java, Javascript or in Velocity ? ( what is better ?)

I am trying to use javascript : (HTML option)

<!-- only a test -->

<script type="text/javascript">


pr = document.getElementById('Project');

alert(pr.value);

</script>

Result it not compiles --- ( error in line 1 )

:::::::::::::::

in " templates " section : can I use a macro ? like this ? ( velocity macro )

## script info

#set($UserGroups=$userAccessor.getGroupNamesForUserName($action.remoteUser.name))

## Participating offices ::::::::::::::::::::::::::

#if ($UserGroups.contains("cyprus-agents") )

$!Greek


#elseif ($UserGroups.contains("denmark-agents") )

$!Danish


#elseif ($UserGroups.contains("ohim-knowledge-administrators") )


$!Spanish
$!English

#else ## :::::::::::::: OHIM :::::

$!Spanish
$!English

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
February 6, 2013

You can put groovy in the groovy box, or velocity in the template bit. I would try to do it in groovy alone and see how you get on. Go through some of the examples... there are too many wrong things here to call them out one by one.

jmsantam
February 6, 2013

ok, yes it seems that the normal way is in groovy

jmsantam
February 18, 2013

thanks,

I Like groovy

xd, it can be done with JIRA :), without scripting :) in custom fields :) ,

TAGS
AUG Leaders

Atlassian Community Events