Forums

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

JellyScript run different when is a Jira Service

Marc Cortinas Val
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 25, 2012

Hello,

I have a script to import users to Jira from Jira Jelly Script File. When i run this script from Jira Runner this finished succesfully, but when i run this script as a service from our Jira aplition we receive an error like this. Can you help me?

Error Message:

{code}

<Error action="AddUser">

<TagContents>(CreateUser(username=jesus.perez)(email=jesus.perez@groupalia.com)(password=jesus.perez)(confirm=jesus.perez)(fullname=Jesus Perez Batlles))</TagContents>

<ExecutedAs>user=null</ExecutedAs>

<ErrorMessage>

Tag CreateUser requires (jelly.username) variables to be set in the Context

</ErrorMessage>

</Error>

{code}

XMLJelly script: /opt/jira/atlassian-jira-enterprise-4.2.4-b591-standalone/atlassian-jira/WEB-INF/classes/services/com/atlassian/jira/service/services/jelly/entrada.xml

{code}

<JiraJelly xmlns:jira="jelly:com.atlassian.jira.jelly.JiraTagLib">

<jira:CreateUser username="jesus.perez" password="jesus.perez" confirm="jesus.perez" fullname="Jesus Perez Batlles" email="jesus.perez@groupalia.com"/>

</JiraJelly>

{code}
Thanks in advance,
Marc
PS: My environment is this one:
[root@GRPNEXJIRA01 jelly]# java -version
java version "1.6.0_24"
Java(TM) SE Runtime Environment (build 1.6.0_24-b07)
Java HotSpot(TM) 64-Bit Server VM (build 19.1-b02, mixed mode)
[root@GRPNEXJIRA01 jelly]# uname -a
Linux GRPNEXJIRA01 2.6.18-194.26.1.el5 #1 SMP Tue Nov 9 12:54:20 EST 2010 x86_64 x86_64 x86_64 GNU/Linux
[root@GRPNEXJIRA01 jelly]# cat /etc/redhat-release
CentOS release 5.5 (Final)

1 answer

0 votes
NielsJ
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 Leaders.
January 25, 2012

When you run the Script via the script runner you provide a user context (since you are logged in). That is not true for the running service. So you have to login first in your Jelly Script.

http://confluence.atlassian.com/display/JIRA/Jelly+Tags#JellyTags-jiraLogin

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events