Hi Team,
I want to search questions that I have answered and which were not marked as accepted.
There might be some questions where the reporter is awaiting subsequent response on question that I answered. Currently I need to manually search each and every question to see whether I have answered and closed the loop.
Can we get such filter ? Is there any better way to find/filter such questions ?
Oh hey - so if you have curl and grep installed (standard in OS X Terminal), this should work:
curl -s 'https://community.atlassian.com/api/2.0/search?api.pretty_print=true&q=SELECT%20view_href%20FROM%20messages%20WHERE%20author.id=%27554991%27%20AND%20is_answer=true%20AND%20is_solution=false%20LIMIT%201000' | grep view_href
So 554991 is your @Kishan Sharma user-id, which I found by clicking on your profile.
I went overly deep into this here but the gist of it is that we're hitting the API for the Khoros software that runs the Atlassian Community, and that API does have the data you're looking for.
Here's the query broken out, and I've converted the %20s to spaces and the %27 to single quotes:
This is the endpoint:
https://community.atlassian.com/api/2.0/search?
This makes it print the JSON output nicely and then sets up the query:
api.pretty_print=true&q=
So here's the actual query, in LiQL (free account required to view docs, ugh) which is similar to SQL. To make things faster, we are only requesting one field be returned: the link (view_href) to the message:
SELECT view_href
Here's the table we're querying, messages:
FROM messages
And here's where we add a filter for your user-id:
WHERE author.id='554991'
And then we make sure we're only getting posts where the message is an answer but it has not been accepted. So we're filtering on the is_answer and is_solution fields:
AND is_answer=true AND is_solution=false
Max number of results is 1000. Hopefully you don't have more than 1000 unaccepted answers:
LIMIT 1000
OOOH, and duh, if you have Firefox, or get the JSON Viewer extension for Chrome/Brave, you can just hit this URL:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I've added conversation.solved to the results to show if somebody else's answer has been accepted, but I can't figure out why the API won't allow me to query on that field, even though their examples show that it should work. (Enh - it has to do with depth=0 being required, which doesn't work here because your answers are all depth=1. I'll call this field broken.)
Very odd:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So if you install jq, you can further filter the query for to only questions that have not been marked as answered by somebody else:
curl -s 'https://community.atlassian.com/api/2.0/search?api.pretty_print=true&q=SELECT%20view_href,conversation.solved%20FROM%20messages%20WHERE%20author.id=%27554991%27%20AND%20is_answer=true%20AND%20is_solution=false%20LIMIT%201000' | jq '.data.items[] | select(.conversation.solved==false)|.view_href'
That's curl, taking the results of the query above, piped through jq with a filter that only returns the view_href field for messages where conversation.solved is false.
Apparently 450 of your answers are in that state. So um, have fun reviewing all those. :-}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Whoa that's a lot of information to absorb, I'll try and process this, thank you so much for your help :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Heh, sorry. Sometimes I overdo it. :-}
Yeah, luckily I dug into this previously, but it was fun to poke around at it again.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
don't be, sometimes it necessary too 😄
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ah, luckily Khoros (software that runs Atlassian Community) also has their own community, and somebody there helped me out.
The following link should give you a nice set of links to all questions that you have participated in that are still not marked as solved, per your original request:
To break the query down to be more readable:
SELECT view_href
FROM messages
WHERE participants.id = '554991'
AND author.id != '554991'
AND depth=0 AND conversation.solved = false
LIMIT 1000
So the trick here is using participants.id, which means you participated in a question (asked/answered/commented), but then we make sure you weren't the author of the original question.
I think the only problem with this is it might also include questions where you commented on somebody else's answer. To filter those out, would probably require an additional query, checking only for messages with a depth of 1 (answers). But depth can only be zero. Hrm...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is really great help @Darryl Lee this will do for now and I'll also explore more options around this. Thanks you so very much 😃
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Unfortunately, we as Community Members or Leaders do not have that ability. It has been discussed but there are limitations with the app (Khoros) that complicate implementation.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for the information Jack!
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.