Questions for Confluence license has expired.

Please purchase a new license to continue using Questions for Confluence.

isUserAssignable() throws missing projectkey error when key is provided

 
1
0
-1

We're currently setting up a sync between two instances, and we also want to sync the watchers if they have an account.
In the documentation we found the nodeHelper.isUserAssignable to check if a user can be assigned to an issue within the project.
But once we trigger the code we get a sync error "Script error details: No project or issue key was provided." even though the project key is provided as per the documentation (https://docs.idalko.com/exalate/display/ED/isUserAssignable).
If we remove the snippet the synchronization works again.


The code we want to use:

def watchUser = nodeHelper.getUserByEmail(userEmail)
if(nodeHelper.isUserAssignable("QGO", watchUser))
{
	return watchUser;
}
return null;

The code which works (except if the user cannot be assigned due to missing permissions):

return nodeHelper.getUserByEmail(userEmail) ?: null;

Stack trace:
exalate-stacktrace.txt

    CommentAdd your comment...

    2 answers

    1.  
      2
      1
      0

      Hi! This was a bug that was already fixed.


      Thanks for reporting!


      Juan

        CommentAdd your comment...
      1.  
        1
        0
        -1

        Hi Michel Bakker

        Is this a visual or scripted connection?


        1. Michel Bakker

          This is a scripted connection.

        2. Francis Martens (Exalate)

          Michel Bakker

          Can you share the stack trace - it can be found in the details of the error

        3. Michel Bakker

          Sure, you can find it in the description.

        4. Francis Martens (Exalate)


          Could you run the following query against your Jira cloud

          <jcloudurl>/rest/api/3/user/assignable/search?project=QGO

          It will provide a list of all the users who are assignable on that project, including accountId's

          Then try
          <jcloudurl>/rest/api/3/user/assignable/search?project=QGO&accountId=XXX

          Where XXX is either an existing accountId or a bogus.
          For the first type (existing accountId) it must return the user record. For the second type an id.

          Please share the results without providing the details (or add them to the support ticket)
          Is there anything outside the expected?

        5. Michel Bakker

          Result for an existing accountId:

          [
              {
                  "self": "https://***.atlassian.net/rest/api/3/user?accountId=***",
                  "accountId": "***",
                  "accountType": "atlassian",
                  "emailAddress": "***@***",
                  "avatarUrls": {
                      "48x48": "***",
                      "24x24": "***",
                      "16x16": "***",
                      "32x32": "***"
                  },
                  "displayName": "***",
                  "active": true,
                  "timeZone": "Europe/Amsterdam",
                  "locale": "nl_NL"
              }
          ]

          Result for a non-existing accountId:

          []
        CommentAdd your comment...