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 ?
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.
EDITED because the final answer is buried in the comments:
BEGINNING OF LONG JOURNEY
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:
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
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:
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
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. :-}
Thank you for the information Jack!
Ohai. I gritted my teeth, learned the bare minimum Javascript required, and wrote a thing:
https://darryl.com/unaccepted
Basically copy the link to your profile ID (it's under your Avatar, as "View Profile"). If you're handy with right-click/ctrl-click you can skip actually going to the page:
Then paste it into my silly little website above. You'll then get a link you can bookmark whenever you want to check back on questions you've answered that were never accepted.
Hi @Darryl Lee , the link doesn't seem to work,
Thanks @Jack Brickey! It's fixed now.
That's what happens when I decide to rename something at the last minute. (Originally the site was called "Unanswered" until I realized that's not quite accurate.)
I'm not crying, you're crying!
This is sweet, thank you for making this @Darryl Lee ! Sending Kudos your way 🙌
It looks like you're new here. Sign in or register to get started.