Forums

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

Jira CLI help with updateUserProperty and removeUserProperty combined

Kamesh S S
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!
August 16, 2022

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!

1 answer

0 votes
Brant Schroeder
Community Champion
January 1, 2023

@Kamesh S S Welcome to the Atlassian community

I would suggest submitting a support issue to the app owner https://marketplace.atlassian.com/apps/6398/jira-command-line-interface-cli?tab=support&hosting=server 

Suggest an answer

Log in or Sign up to answer