Hi All,
I want to create a dynamic filter as soon as Version is created. Based on the version values, like version name and version description, need to create a dynamic filter and save it as version description name. once done, need to edit the filter permissions. can you please help on this. here is the screenshot of what i am doing.
As @John Funk rightly mentioned this cannot be achieved out of the box, since the {{version}} is limited to provide only the version name and version ID.
In theory you can do this as a workaround :
You might need to do some trial and error with the create Filter API since the input may not be in the specified format needed.
Do let us know how it goes.
PS: would recommend Hidding the Auth token in your image
Hi @Abhishek Kalamkar ,
As shown in your image
This webrequest should work (in theory), do you get any error? What is not working in this use case now?
Also, as a request please use the individual thread for responding to each response, so that we have a more clear line of reasoning. :-)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Jehan Bhathena : please find the error. I have tried multiple ways, it will allow only text value but not {{version.name}} or {{webResponse.body.description}}
When I try for Get, custom data - that works fine for me as it retrieves all the filters data.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Abhishek Kalamkar , you cannot validate a request that uses a smart value.
For {{webResponse.body.description}} to be resolved the first Webrequest needs to be fired, once done, the next request will use the output from the first request in the body.
As of now, you're trying to send a empty value in your request that is why you receive the error "name has to be provided".
Would recommend triggering the automation and let the whole automation run and see if it works.
Let us knw how it goes.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Jehan Bhathena : you wont believe, even the JQL is working fine. It is accepting below and able to create filters based on create version. Thank you Thank you Thank you.
Now only pending part is how to edit the filters permissions dynamically.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
To edit the filters owner and editor you need to add the "sharePermissions" In the body of the request.
You can find that in the documentation here : https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-filters/#api-rest-api-3-filter-post
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Jehan Bhathena do I need to create another webhook request as the web request URL will be different and update the body to add the "sharePermissions" like below ? or can I add the "sharePermissions" in webhook request where I created the filters.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Abhishek Kalamkarbelow is the Body you can use with this API https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-filters/#api-rest-api-3-filter-post, you dont need to create a new webRequest
{
"jql": "<JQL>",
"name": "<name>",
"editPermissions": [
{
"type": "user",
"user":
{
"accountId": "<<account ID>>"
}
}
],
"sharePermissions": [
{
"type": "group",
"group":
{
"groupId": "<<groupID>>"
}
}
]
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you so much @Jehan Bhathena that works fine for group, project, users etc. if possible, can "My organization"be added. its not allowing me to add My organization in the viewers list
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Abhishek Kalamkar Glad to know it works.
For the "My Organization" part, I didn't find any direct setting for this but the below workaround should suffice:
Hopefully this should work.
Please let us know how it goes, also, if this thread helped solve your original query would be great if you can mark this thread as the Accepted answer.
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.
@Jehan Bhathena sorry to bother you again. i have created a filter manually and fetch the details. please see below.
Seems like the id referring is the filter ID not the filter permission "My Organization " id. so not updating the filter Viewers permission as not have much data for sharepermissions.
FYI - Edit permissions are working fine.
"sharePermissions": [
{
"id": 40837140
"type": "loggedin"
}
]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Abhishek Kalamkar ,
for the "My Organization" Query would recommend creating a new question, since the main threadis already addressed in the current thread.
With a new question you're more likely to get more inputs. 🙂
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Jehan Bhathena : one last question for this post -
can I create two filter in one webhook request. somehow it is creating only first filter and not second one. some syntax error i guess.
{
"name": "{{webResponse.body.description}} Fix Version",
"description":"{{webResponse.body.name}}",
"jql":"fixversion = {{version.name}}"
},
{
"name": "{{webResponse.body.description}} Exception Version",
"description":"{{webResponse.body.name}}",
"jql":"fixversion = {{version.name}}"
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
you will need to create a new webrequest for the second filter.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Jehan Bhathena Thank you for your answer. below is working for me as it is only the text value. As you mentioned, I only need the {{version.name}} value should be name field and JQL should use JQL: "to use smart value"
"name": "{{version.name}}" --> Filter name should save as value of {{version.name}}. filter name should save as CWC 9.5
This is what I have tried but no luck.
@Bill Sheboy : Thank you for your input. I don't really care about the description. If possible, I would like to have version description or version name same as above screenshot which is CWC 9.5
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Adding onto the answers already provided...you note wanting to name your new, saved filter using the just-created version's description.
What information are you putting into the version description?
It is possible that your description contains text which cannot be saved as a filter name, so please keep that in mind when creating this rule. Some work-arounds could be to remove/replace any characters in the description which are not permitted in saved, filter names, or to instead use the version name.
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Abhishek - Sorry, but you will not be able to do any of those things with an Automation rule.
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 are welcome.
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.