How to retrieve a mentioned user's name from cql ?

sabzx February 10, 2020

I would like to retrieve the mentioned user's name (mentionee)  from the CQL REST API.

Currently it only gives me the username of the person who mentioned another user (mentioner). 

 

Eg query:

http://localhost:8090/rest/api/content/search?cql=(mention != 'anonymous' and type='comment' and created>now("-1w") )&expand=metadata.properties

 

Eg response: 

Here the "version" key contains the user who mentioned another user's name

 

{
"id": "65629",
"type": "comment",
"status": "current",
"title": "Re: Product",
"version": {
"by": {
"type": "known",
"username": "ken",
"userKey": "ff8080817011ca7d017011d7591e0002",
"profilePicture": {
"path": "/images/icons/profilepics/default.svg",
"width": 48,
"height": 48,
"isDefault": true
},
"displayName": "Kenneth",
"_links": {
"self": "http://localhost:8090/rest/api/user?key=ff8080817011ca7d017011d7591e0002"
},
"_expandable": {
"status": ""
}
},
"when": "2020-02-07T10:08:16.165-05:00",
"message": "",
"number": 1,
"minorEdit": false,
"hidden": false,
"_links": {
"self": "http://localhost:8090/rest/experimental/content/65629/version/1"
},
"_expandable": {
"content": "/rest/api/content/65629"
}
},
"extensions": {
"location": "footer",
"_expandable": {
"resolution": ""
}
},
"_links": {
"webui": "/display/PROD/Product?focusedCommentId=65629#comment-65629",
"self": "http://localhost:8090/rest/api/content/65629"
},
"_expandable": {
"container": "/rest/api/content/65591",
"metadata": "",
"operations": "",
"children": "/rest/api/content/65629/child",
"restrictions": "/rest/api/content/65629/restriction/byOperation",
"history": "/rest/api/content/65629/history",
"ancestors": "",
"body": "",
"descendants": "/rest/api/content/65629/descendant",
"space": "/rest/api/space/PROD"
}

2 answers

0 votes
sabzx February 25, 2020

Any thoughts on this guys?

0 votes
sabzx February 11, 2020

Is there any other alternative solution ?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events