I am developing an application that uses the JIRA 6.1 REST API. Can I know a sample JSON Object that I should use, to add a user to a given group in JIRA?
This is the relevant API call: https://docs.atlassian.com/jira/REST/latest/#d2e1694
I am developing an application that uses the JIRA 6.1 REST API. Can I know a sample JSON Object that I should use, to add a user to a given group in JIRA?
This is the relevant API call: https://docs.atlassian.com/jira/REST/latest/#d2e1694
curl -D- -u admin:password -X POST --data "{\"name\": \"charlie\",\"password\": \"abracadabra\",\"emailAddress\": \"charlie@atlassian.com\",\"displayName\": \"Charlie of Atlassian\"}" -H "Content-Type: application/json" http://jira.server.com/rest/api/2/user/
有关更多信息,请参阅。展开 application/json 下的部分,您可以在其中找到数据示例。
如何发送查询,请参阅Atlassian 的文档。
在寻找做完全相同的事情时遇到了这个线程。@ThePavolC 的答案非常好,但它是在创建一个新用户,而不是在一个组中添加一个用户。我将他的回答与来自https://answers.atlassian.com/questions/255778的信息结合起来,得出了这个单行字:
curl --insecure -D- -u admin:password -X POST --data "{\"name\": \" username \"}" -H "Content-Type: application/json" https:// myjiraserver. com /rest/api/2/group/user?groupname= mygroupname
我添加了 --insecure 选项,因为我的服务器上使用了私有 SSL 证书。您可能不需要,或者您可能根本没有使用 HTTPS(在这种情况下,请编辑 URL 以使用 HTTP)。