You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Scenario:
We have an Employees Insight object with an attribute called System Name that stores all applications an user has access.
Using Jira Automation, I can update via webhook to add more applications, but when I try to edit the object to remove, it overwrites the whole attribute.
I want a way to remove a single value from the attributes. Does anyone know if that is possible?
Just like is shown here, but I adapted it to my ids
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @maurício heberle ,
did you also add the log action from point 4 in the docu:
Add a log action within the branch to make sure we get the desired results:
List of application: {{object."Application access".Key.asJsonObject("value")}},{{"Application List".Key.asJsonObject("value")}} object to be edited: {{object.id}}
Is there any information in your audit log? Could you show the result of your audit log? That might help the community to get further insight into the problem and try to find a solution.
Best
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Stefan Salzl
how can we remove a single value in a object attribute
instead of adding new values
Example: using automation we can clear all the values in the attribute
But now in my case i need to remove a single value (PF347890)
Is there any way
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I forgot to answer this. I think theres no native solution at the moment, because theres no api endpoint for it.
I believe the best way would be using scriptrunner
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Not sure if it works though
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
as @Mauricio Heberle already mentioned there is no native endpoint solve this. I also tried several ways to solve (with smartValues, iteration and condition) but it´s really tricky.
Could you describe your use in more details? When should an attribute be deleted? where does the information come from which attribute should be deleted?
Did you check the scripted solution from the link above?
Best
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @maurício heberle ,
Probably you already solve this, but I found a way to remove an attribute with native functionality. To explain it better I'm going to use this example. You have 2 object types: the first is a group object type and the second is a Users object type. The User has an attribute called Group(s) where you associate the user to all the groups is part of. In the example we will be removing one group from the user. The steps in the automation will be the following:
{Where the objectTypeAttributeId 70 is the group id reference in the User object. Replace the US with the asset key from your instance.
"attributes": [
{
"objectTypeAttributeId": "70",
"objectAttributeValues": [
{{listgroups.remove(keygroup).match("(US-\d\d*)").asJsonObject("value").replace(", ","\"}, {\"value\": \"")}}
]
}
]
}
I hope this helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Benavides_ Fernando
Thanks for the automation
For my use case
there are two object types
A- Employee details
B - Device details
If you find the below picture
1. An Object "7741" in A object type has attribute Emp_Hardware with two appended values pushed via automation
2. And B object type has an attribute called Quantity (if the device is assigned quantity will be set to 0, and 1 for unassigned)
- Now i have created a request type in portal named unassign a device,
- When reporter creates a ticket he selects the object in first field Employee details (pulls all objects in A object type) as 7741
- In the second insight field he selects the device details objects as PF347890
its backend configuration with IQL
Field Name: E_Assigned_Device
Filter scope (AQL): objecttype="Device Details"
Filter issue scope (AQL): "Assigned To"=${customfield_XXXX} (XXXX is above field)
**The value PF347890 selected in the field should be removed from the Emp_Hardware attribute
When ticket is moved to closed status**
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In this case you could skip the 2 step. The steps could be like this:
{
"attributes": [
{
"objectTypeAttributeId": "XX",
"objectAttributeValues": [
{{hardwareList.remove(deviceRemoved).match("(AM-\d\d*)").asJsonObject("value").replace(", ","\"}, {\"value\": \"")}}
]
}
]
}
The objecttypeAtributeId must be get it from the 7741 object type.
I'm assuming the hardware is using a AM key, if that's not the case update the AM in the body.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Benavides_ Fernando It worked!!!! Thank you!!!
I did try using remove with JSON, but my scripting skills werent enough to solve it.
How'd you find that out?
Anyway, I was freaking out about this back then and now I can proceed with it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Benavides_ Fernando
I have tried the automation but it doesn't works
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Show us your whole automation, the API call and the issue which you are trying to modify, please
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try removing the "For current issue" branch. I am using only the AQL on Branch
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What I meant is that you dont need another branch like the current issue. This is my automation
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.