Forums

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

JIRA Add User properties by scripting

Sven Lecherbonnier January 30, 2013

Hi,

I'm trying to add a new property with a value through a wget script.

I'm trying to run this kind of URL with no success :

http://localhost:$$$$/secure/admin/user/EditUserProperties.jspa?key=<mypropertyname>&value=<myvalue>&name=<myuser>&+Add+=+Add+

I did the autication before that, my script is working except that.

Do you have an idea ?

Maybe you are using another way ?

Regards,

Sven.

2 answers

1 accepted

1 vote
Answer accepted
Bob Swift
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 31, 2013
Sven Lecherbonnier February 5, 2013

Greath Thanks Bob.

I found also another way by Jelly using core functionality.

pawan sonu
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!
October 19, 2015

Hey Sven, Can you share the another way of doing it ? pawansonu4@gmail.com

0 votes
Sven Lecherbonnier February 5, 2013

This is working well too :

&lt;JiraJelly xmlns:jira="jelly:com.atlassian.jira.jelly.enterprise.JiraTagLib" xmlns:core="jelly:core" xmlns:email="jelly:email" xmlns:log="jelly:log" xmlns:util="jelly:util" &gt;
&lt;log:warn&gt;  example log &lt;/log:warn&gt;

&lt;core:invokeStatic className="com.atlassian.jira.component.ComponentAccessor" method="getUserManager" var="usermanager"/&gt;
&lt;core:invoke on="${usermanager}" method="getUser" var="user"&gt;
&lt;core:arg type="java.lang.String" value="myusername"/&gt;
&lt;/core:invoke&gt;

&lt;core:invokeStatic className="com.atlassian.jira.component.ComponentAccessor" method="getUserPropertyManager" var="propertymanager"/&gt;
&lt;core:invoke on="${propertymanager}" method="getPropertySet" var="propertyset"&gt;&lt;core:arg type="com.atlassian.crowd.embedded.api.User" value="${user}"/&gt;
&lt;/core:invoke&gt;

&lt;core:invoke on="${propertyset}" method="setString"&gt;
&lt;core:arg type="java.lang.String" value="jira.meta.myproperty"/&gt;
&lt;core:arg type="java.lang.String" value="myvalueproperty"/&gt;
&lt;/core:invoke&gt;

&lt;/JiraJelly&gt;

No plugin needed

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events