Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wrong-type-argument stringp replace-regexp-in-string (at ejira--parse-sprint) #38

Open
kaue opened this issue Nov 24, 2020 · 20 comments
Open

Comments

@kaue
Copy link

kaue commented Nov 24, 2020

After using M-x ejira-update-my-projects, i m getting this error:

wrong-type-argument stringp replace-regexp-in-string (at ejira--parse-sprint)

Debug
ejira--parse-sprint(((id . 140) (name . "AB Sprint 01") (state . "active") (boardId . 11) (goal . "") (startDate . "2020-11-23T14:16:01.557Z") (endDate . "2020-11-30T03:30:00.000Z")))

Stack

  string-match()
  replace-regexp-in-string()
  ejira--parse-sprint()
  mapcar(ejira--parse-sprint())
  ejira-get-sprint-name()
  ejira--parse-item()
@nyyManni
Copy link
Owner

If I undersood correctly it seems that the sprint is already parsed when giving it to ejira--parse-sprint. In my case the value given to it is an array of strings of form: "com.atlassian.greenhopper.service.sprint.Sprint@5a4e578[id=340,rapidViewId=469,state=FUTURE,name=Sprint 7,startDate=<null>,endDate=<null>,completeDate=<null>,sequence=340,goal=<null>]"

Does this happen with any JIRA issue that has a sprint linkage, or just some?

@kaue
Copy link
Author

kaue commented Nov 26, 2020

Im not sure @nyyManni, i can't use ejira-update-my-projects. i always get this error and an empty org file at my ejira folder.

@kaue
Copy link
Author

kaue commented Nov 26, 2020

This maybe related with this jira project being next gen. I didn't had this problem with the previous jira project i was using (classic)

@kaue
Copy link
Author

kaue commented Nov 26, 2020

replace-regexp-in-string: Wrong type argument: stringp, ((id . 140) (name . "AA Sprint 01") (state . "active") (boardId . 37) (goal . "") (startDate . "2020-11-23T14:16:01.557Z") (endDate . "2020-11-30T03:30:00.000Z"))

@nyyManni
Copy link
Owner

It certainly looks like the "next gen" project is giving the sprint information in an alread-parsed format.

Supporting it would be straightforward, though I would likely need a sample of the full json-payload returned from the API.

@kaue
Copy link
Author

kaue commented Nov 26, 2020

@nyyManni how can i get the json payload?

@nyyManni
Copy link
Owner

Easiest is to use a browser and go to <jiralib2-url>/rest/api/2/issue/<issue-key>. Select an issue from the next gen jira project, and pick one that for sure has a sprint linked to it. It is going to return you a big chunk of json-data, which is what ejira uses to generate the org-heading.

@kaue
Copy link
Author

kaue commented Nov 27, 2020

@nyyManni check if you can reproduce with this json:

{
  "expand": "renderedFields,names,schema,operations,editmeta,changelog,versionedRepresentations",
  "id": "32987",
  "self": "https://aaa.atlassian.net/rest/api/2/issue/32987",
  "key": "AA-1000",
  "fields": {
    "statuscategorychangedate": "2020-11-17T15:11:09.719-0400",
    "parent": {
      "id": "31099",
      "key": "AA-100",
      "self": "https://aaa.atlassian.net/rest/api/2/issue/31099",
      "fields": {
        "summary": "ABC",
        "status": {
          "self": "https://aaa.atlassian.net/rest/api/2/status/10146",
          "description": "",
          "iconUrl": "https://aaa.atlassian.net/",
          "name": "To Do",
          "id": "10146",
          "statusCategory": {
            "self": "https://aaa.atlassian.net/rest/api/2/statuscategory/2",
            "id": 2,
            "key": "new",
            "colorName": "blue-gray",
            "name": "To Do"
          }
        },
        "priority": {
          "self": "https://aaa.atlassian.net/rest/api/2/priority/3",
          "iconUrl": "https://aaa.atlassian.net/images/icons/priorities/medium.svg",
          "name": "Medium",
          "id": "3"
        },
        "issuetype": {
          "self": "https://aaa.atlassian.net/rest/api/2/issuetype/10042",
          "id": "10042",
          "description": "Epics track collections of related bugs, stories, and tasks.",
          "iconUrl": "https://aaa.atlassian.net/secure/viewavatar?size=medium&avatarId=10307&avatarType=issuetype",
          "name": "Epic",
          "subtask": false,
          "avatarId": 10307,
          "entityId": "281e71fd-abd0-4800-96c9-187ceca5ec0b"
        }
      }
    },
    "customfield_10070": null,
    "customfield_10071": null,
    "customfield_10072": 3.0,
    "customfield_10073": null,
    "customfield_10074": null,
    "customfield_10076": null,
    "customfield_10077": null,
    "fixVersions": [
      
    ],
    "customfield_10078": null,
    "resolution": null,
    "lastViewed": "2020-11-27T09:06:55.350-0400",
    "customfield_10060": null,
    "customfield_10061": null,
    "customfield_10063": null,
    "customfield_10064": null,
    "customfield_10065": null,
    "customfield_10067": null,
    "priority": {
      "self": "https://aaa.atlassian.net/rest/api/2/priority/3",
      "iconUrl": "https://aaa.atlassian.net/images/icons/priorities/medium.svg",
      "name": "Medium",
      "id": "3"
    },
    "customfield_10068": null,
    "customfield_10069": null,
    "labels": [
      
    ],
    "aggregatetimeoriginalestimate": null,
    "timeestimate": null,
    "versions": [
      
    ],
    "issuelinks": [
      
    ],
    "assignee": {
      "self": "https://aaa.atlassian.net/rest/api/2/user?accountId=123456adfgaso",
      "accountId": "123456adfgaso",
      "emailAddress": "[email protected]",
      "avatarUrls": {
        "48x48": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/40f3f379-341f-4c33-9e44-689877042111/48",
        "24x24": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/40f3f379-341f-4c33-9e44-689877042111/24",
        "16x16": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/40f3f379-341f-4c33-9e44-689877042111/16",
        "32x32": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/40f3f379-341f-4c33-9e44-689877042111/32"
      },
      "displayName": "My Name",
      "active": true,
      "timeZone": "America",
      "accountType": "atlassian"
    },
    "status": {
      "self": "https://aaa.atlassian.net/rest/api/2/status/10146",
      "description": "",
      "iconUrl": "https://aaa.atlassian.net/",
      "name": "To Do",
      "id": "10146",
      "statusCategory": {
        "self": "https://aaa.atlassian.net/rest/api/2/statuscategory/2",
        "id": 2,
        "key": "new",
        "colorName": "blue-gray",
        "name": "To Do"
      }
    },
    "components": [
      
    ],
    "customfield_10050": null,
    "customfield_10051": null,
    "customfield_10052": null,
    "customfield_10053": null,
    "customfield_10054": null,
    "customfield_10055": null,
    "customfield_10056": null,
    "customfield_10057": null,
    "customfield_10058": null,
    "customfield_10059": null,
    "customfield_10049": null,
    "aggregatetimeestimate": null,
    "creator": {
      "self": "https://aaa.atlassian.net/rest/api/2/user?accountId=123123",
      "accountId": "213213213",
      "emailAddress": "[email protected]",
      "avatarUrls": {
        "48x48": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/213213/40f3f379-341f-4c33-9e44-689877042111/48",
        "24x24": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/123123/40f3f379-341f-4c33-9e44-689877042111/24",
        "16x16": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/123/40f3f379-341f-4c33-9e44-689877042111/16",
        "32x32": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/21312231/40f3f379-341f-4c33-9e44-689877042111/32"
      },
      "displayName": "My Name",
      "active": true,
      "timeZone": "America",
      "accountType": "atlassian"
    },
    "subtasks": [
      
    ],
    "customfield_10040": null,
    "customfield_10041": null,
    "customfield_10042": null,
    "reporter": {
      "self": "https://aaa.atlassian.net/rest/api/2/user?accountId=123213",
      "accountId": "123213",
      "emailAddress": "[email protected]",
      "avatarUrls": {
        "48x48": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/123213/40f3f379-341f-4c33-9e44-689877042111/48",
        "24x24": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/123213/40f3f379-341f-4c33-9e44-689877042111/24",
        "16x16": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/123213/40f3f379-341f-4c33-9e44-689877042111/16",
        "32x32": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/213213/40f3f379-341f-4c33-9e44-689877042111/32"
      },
      "displayName": "My Name",
      "active": true,
      "timeZone": "America",
      "accountType": "atlassian"
    },
    "customfield_10043": null,
    "customfield_10044": null,
    "aggregateprogress": {
      "progress": 0,
      "total": 0
    },
    "customfield_10045": null,
    "customfield_10046": null,
    "customfield_10047": null,
    "customfield_10048": null,
    "customfield_10038": null,
    "customfield_10039": null,
    "progress": {
      "progress": 0,
      "total": 0
    },
    "worklog": {
      "startAt": 0,
      "maxResults": 20,
      "total": 0,
      "worklogs": [
        
      ]
    },
    "issuetype": {
      "self": "https://aaa.atlassian.net/rest/api/2/issuetype/10048",
      "id": "10048",
      "description": "",
      "iconUrl": "https://aaa.atlassian.net/secure/viewavatar?size=medium&avatarId=10323&avatarType=issuetype",
      "name": "Security",
      "subtask": false,
      "avatarId": 10323,
      "entityId": "cb4c1932-1888-4882-b88d-0a5911bf9e87"
    },
    "timespent": null,
    "customfield_10030": null,
    "customfield_10031": null,
    "project": {
      "self": "https://aaa.atlassian.net/rest/api/2/project/10034",
      "id": "10034",
      "key": "AA",
      "name": "Blabla Software",
      "projectTypeKey": "software",
      "simplified": true,
      "avatarUrls": {
        "48x48": "https://aaa.atlassian.net/secure/projectavatar?pid=10034&avatarId=10585",
        "24x24": "https://aaa.atlassian.net/secure/projectavatar?size=small&s=small&pid=10034&avatarId=10585",
        "16x16": "https://aaa.atlassian.net/secure/projectavatar?size=xsmall&s=xsmall&pid=10034&avatarId=10585",
        "32x32": "https://aaa.atlassian.net/secure/projectavatar?size=medium&s=medium&pid=10034&avatarId=10585"
      }
    },
    "customfield_10032": null,
    "customfield_10033": null,
    "aggregatetimespent": null,
    "customfield_10034": null,
    "customfield_10035": null,
    "customfield_10036": null,
    "customfield_10037": null,
    "customfield_10027": null,
    "customfield_10028": [
      
    ],
    "customfield_10029": null,
    "resolutiondate": null,
    "workratio": -1,
    "issuerestriction": {
      "issuerestrictions": {
        
      },
      "shouldDisplay": true
    },
    "watches": {
      "self": "https://aaa.atlassian.net/rest/api/2/issue/AA-1876/watchers",
      "watchCount": 1,
      "isWatching": true
    },
    "created": "2020-11-17T15:11:09.408-0400",
    "customfield_10026": null,
    "customfield_10018": [
      {
        "self": "https://aaa.atlassian.net/rest/api/2/customFieldOption/10003",
        "value": "Impediment",
        "id": "10003"
      }
    ],
    "updated": "2020-11-23T08:50:20.258-0400",
    "timeoriginalestimate": null,
    "description": "some random description",
    "customfield_10010": [
      {
        "id": 136,
        "name": "AA Sprint 8",
        "state": "closed",
        "boardId": 37,
        "goal": "",
        "startDate": "2020-11-16T14:23:25.959Z",
        "endDate": "2020-11-23T03:52:19.000Z",
        "completeDate": "2020-11-23T12:31:21.872Z"
      },
      {
        "id": 140,
        "name": "AA Sprint 09",
        "state": "active",
        "boardId": 37,
        "goal": "",
        "startDate": "2020-11-23T14:16:01.557Z",
        "endDate": "2020-11-30T03:30:00.000Z"
      }
    ],
    "customfield_10011": "1|i02mj8:y",
    "customfield_10012": null,
    "customfield_10013": null,
    "customfield_10014": null,
    "timetracking": {
      
    },
    "security": null,
    "customfield_10008": null,
    "customfield_10009": {
      "hasEpicLinkFieldDependency": false,
      "showField": false,
      "nonEditableReason": {
        "reason": "PLUGIN_LICENSE_ERROR",
        "message": "The Parent Link is only available to Jira Premium users."
      }
    },
    "attachment": [
      
    ],
    "summary": "some random summary",
    "customfield_10000": "{}",
    "customfield_10001": null,
    "customfield_10004": null,
    "environment": null,
    "duedate": null,
    "comment": {
      "comments": [
        {
          "self": "https://aaa.atlassian.net/rest/api/2/issue/32987/comment/29011",
          "id": "29011",
          "author": {
            "self": "https://aaa.atlassian.net/rest/api/2/user?accountId=123456adfgaso",
            "accountId": "123456adfgaso",
            "emailAddress": "[email protected]",
            "avatarUrls": {
              "48x48": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/123456adfgaso/40f3f379-341f-4c33-9e44-689877042111/48",
              "24x24": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/123456adfgaso/40f3f379-341f-4c33-9e44-689877042111/24",
              "16x16": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/123456adfgaso/40f3f379-341f-4c33-9e44-689877042111/16",
              "32x32": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/123456adfgaso/40f3f379-341f-4c33-9e44-689877042111/32"
            },
            "displayName": "My Name",
            "active": true,
            "timeZone": "America",
            "accountType": "atlassian"
          },
          "body": "something",
          "updateAuthor": {
            "self": "https://aaa.atlassian.net/rest/api/2/user?accountId=123456adfgaso",
            "accountId": "123456adfgaso",
            "emailAddress": "[email protected]",
            "avatarUrls": {
              "48x48": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/123456adfgaso/40f3f379-341f-4c33-9e44-689877042111/48",
              "24x24": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/123456adfgaso/40f3f379-341f-4c33-9e44-689877042111/24",
              "16x16": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/123456adfgaso/40f3f379-341f-4c33-9e44-689877042111/16",
              "32x32": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/123456adfgaso/40f3f379-341f-4c33-9e44-689877042111/32"
            },
            "displayName": "My Name",
            "active": true,
            "timeZone": "America",
            "accountType": "atlassian"
          },
          "created": "2020-11-17T15:11:58.090-0400",
          "updated": "2020-11-17T15:11:58.090-0400",
          "jsdPublic": true
        }
      ],
      "maxResults": 1,
      "total": 1,
      "startAt": 0
    }
  }
}

@nyyManni
Copy link
Owner

Thanks!

Indeed, the sprints are pre-parsed. This would sonehow need to be dynamic, as a user can probably have both classic and next-gen projects at the same time.

This should be enough for me to get with a fix.

@kaue
Copy link
Author

kaue commented Nov 27, 2020

awesome, thanks for the help nyyManni :)

@kaue
Copy link
Author

kaue commented Dec 21, 2020

any updates on this @nyyManni? I might be able to help if you point me in the right direction.
but i don't have much experience with lisp :(

@nyyManni
Copy link
Owner

My apologies for not getting back to this! I pushed a fix candidate to branch fix/preparsed-sprint, go ahead and check if it solves the issue for you.

@Artawower
Copy link

Artawower commented Dec 22, 2020

For me this error disappeared, but now i have another, ejira--set-todo-state: Item IOT21-1017 not found
(but this task is exist) i don't know is it connected to issue or not, but unfortгunatly, i don't see all tasks
(sometime i have another error: user-error: Priority must be between ‘A’ and ‘C’, but external priority is low)

@nyyManni
Copy link
Owner

@Artawower

For the first issue I cannot say anything right away, but for the priority error: have you configured your ejira-priorities-alist to match the priorities in your JIRA instance and set org-lowest-priority accordingly?

@Artawower
Copy link

Ow sorry, i had typo in my config file. Thanks a lot for your fix, now everything works perfectly!

@kaue
Copy link
Author

kaue commented Jan 11, 2021

@nyyManni looks like i am getting a different error now

Successfully configured custom fields
5 files scanned, 2 files contains IDs, and 5 IDs found.
or: Item OA-3027 not found

@kaue
Copy link
Author

kaue commented Jan 11, 2021

the OA.org looks like this

#+STARTUP: showeverything
* OA
:PROPERTIES:
:ID:       OA
:TYPE:     ejira-project
:END:
* <ejira new heading>
:PROPERTIES:
:ID:       OA-3029
:END:
* <ejira new heading>
:PROPERTIES:
:ID:       OA-3029
:END:
* <ejira new heading>
:PROPERTIES:
:ID:       OA-3028
:END:
* <ejira new heading>
:PROPERTIES:
:ID:       OA-3027
:END:

btw, i didin't omit anything its actually showing "ejira new heading"

@nyyManni
Copy link
Owner

is a placeholder for the heading before the actual ticket summary gets loaded in. In this case an error occured somewhere between those two and thus the placeholders remain.

Manually remove those headings, and use org-id-update-id-locations to sync it up.

@kaue
Copy link
Author

kaue commented Feb 5, 2021

@nyyManni looks like the issue happens because its unable to fetch the jira card data, looks like the first id is always reported as not found.

any idea on how to solve this? those ids exist on jira, so its probably another issue with new gen projects.

@MadEarl
Copy link

MadEarl commented Feb 10, 2021

My apologies for not getting back to this! I pushed a fix candidate to branch fix/preparsed-sprint, go ahead and check if it solves the issue for you.

Enountered the same problem after getting assigned to a next-gen project ticket. The fix solves it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants