Forums

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

How do I access a User entity's properties (set via API)?

Alex van Vucht (GLiNTECH)
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.
December 15, 2016

Hi! I love Code Barrel's Automation plugin.

Now, I can set user properties via API:

curl -D- -d'"VIP User"' -u admin:<password> -X PUT -H "Content-Type: application/json" https://<My JIRA Cloud>.atlassian.net/rest/api/2/user/properties/vip?username=admin

And I can similarly retrieve them:

curl -D- -u admin:<password> -X GET https://<My JIRA Cloud>.atlassian.net/rest/api/2/user/properties/vip?username=admin

 

In the Automation plugin, I can retrieve many Reporter's details, eg., if the Reporter is admin, then I can set the Reporter Username custom field this way:

{
    "fields": {
        "Reporter Username": "{{issue.reporter.name}}"
    }
}


It makes sense to me that this should work, to set a VIP User custom field:

{

    "fields": {
        "VIP User": "{{issue.reporter.properties.vip}}"
    }
}

However this doesn't work. How do I access the "vip" property I set on the user entity in the JIRA Automation plugin?

1 answer

1 accepted

1 vote
Answer accepted
Pedro Souza
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 28, 2014

Hi there,

Before doing any delete operations in the database, I would recomend you to rename these users, and then try to delete it again.

Since the username is like an URL, perhaps it might be causing conflict in the application side.

If you're still facing the problem even renaming the user, I would strongly recommend you to backup your database before applying any delete operation on this, when you have the backup, the delete query should be this one:

delete from cwd_user
where user_name in ('http://netsparker.com/n?.jspa', 'php://filter//resource=http://netsparker.com/n?.jspa')

I hope it helps!

Regards.

Kevin Mote
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.
January 28, 2014

Good suggestion, but unfortunately it looks like I will have to wait until I upgrade to v6.0 to edit usernames. (That feature is not available in 5.x). Rather than mucking about in the database, I think I'll wait for my upgrade.

Thanks!

Suggest an answer

Log in or Sign up to answer