Description
Issue Summary
Invite user API does not wait for the user to be created on the site
Steps to Reproduce
1. Invite a user to the site utilizing the following endpoint
Add a user from an approved domain or run the API as a site administrator to not trigger an approval flow.
https://{your-domain}/wiki/api/v2/user/access/invite-by-email
2. Immediately add the same user to a group utilizing the following endpoint
https://your-domain.atlassian.net/wiki/rest/api/group/userByGroupId?groupId={groupId}
Actual Results
- The invite user call will immediately return a 200 OK response code, even if the user is not yet ready on the site.
- The add member to group call will fail because the user was not fully created on the site yet.
{"statusCode":500,"message":"com.netflix.hystrix.exception.HystrixRuntimeException: AddUserToGroupsIdentityPlatformCommand failed and no fallback available."}done
Suggestion
The invite user API should only return the HTTP response code once the user is available on the site.
Workaround
Option 1 : Implement wait time and retry on adding the user to a group.
Option 2 : Use the Jira API for inviting and adding user to a group.
POST https://{your-domain}/rest/api/3/user POST https://{your-domain}/rest/api/3/group/user?groupId={groupID}