Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,360,201
Community Members
 
Community Events
168
Community Groups

Jira CLI help with updateUserProperty and removeUserProperty combined

We have a script that generates a CSV file from our internal tools. jira-cli uses it to update the User Properties fields for them to display on Custom Fields. Its been running fine for years. But there is a small silly bug. Whenever there is a change in our internal record. For eg, someone had their value changed for a property, our CLI just adds it as another value of the same property. The current CSV file generated will not have the value on "value" parameter. What it does is, that it just displays "This function requires a non-blank value for parameter value." as it doesn't contain anything. But Jira on the other hand, will not delete it and will retain its previous value.

How our jira-cli works"

jira.sh --server http://JIRAURL --user thatadminaccount --password ***** --action runFromCsv --file $filename --common \'--action updateUserProperty\' --continue";

User's property (for eg:)

role: Tech Support

dept: Systems & Tech

workstation name: blah-systemname

csv for the above:

userID,name,value

kamesh,role,Tech Support

kamesh,dept,Systems & Tech

kamesh,workstation name,blah-systems

When the user doesn't have a workstation anymore, the csv will have empty value - like below

userID,name,value

kamesh,role,Tech Support

kamesh,dept,Systems & Tech

kamesh,workstation name,

But when we run the above command, it runs and just displays the error as I mentioned above; doesn't delete the said property. I understand that's the default behaviour of the updateUserProperty.

How can I make it so that it also runs removeUserProperty when the value is empty?

Could someone spark some ideas, please? :)

PS: I'm using jira-cli-8.8.0, if that helps.

Thanks!

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira Software

An update on Jira Software customer feedback – June 2022

Hello Atlassian Community! Feedback from customers like you has helped us shape and improve Jira Software. As Head of Product, Jira Software, I wanted to take this opportunity to share an update on...

5,012 views 18 31
Read article

Atlassian Community Events