gajira-find-issue-key icon indicating copy to clipboard operation
gajira-find-issue-key copied to clipboard

TypeError: Cannot read property 'map' of undefined

Open cicciodifranco opened this issue 4 years ago • 6 comments

When I try to use this action with pull_request

on:
  pull_request:
    types: [closed]
    branches: [master]

I receive this error

TypeError: Cannot read property 'map' of undefined

cicciodifranco avatar Dec 23 '20 15:12 cicciodifranco

Until they add proper support for pull_request, you can workaround like so:

  with:
    string: ${{ github.event.pull_request.title }}

finsterdexter avatar Jan 12 '21 19:01 finsterdexter

FYI You can workaround this bug by setting an empty string for the from input:

- uses: atlassian/[email protected]
  with:
    string: ${{ github.event.pull_request.title }}
    from: ""

brennerm avatar Jan 20 '21 16:01 brennerm

Hi All, I am also facing the same error:

Run atlassian/gajira-find-issue-key@master
  with:
    from: commits
Error: TypeError: Cannot read property 'map' of undefined

Is this a valid way to fetch PR object's data? I want to fetch the PR number, title, and description.

    - name: Find in commit messages
      uses: atlassian/gajira-find-issue-key@master
      with:
        from: commits
${{ github.event.pull_request.number }} 
${{ github.event.pull_request.title }}  
${{ github.event.pull_request.description }}

Thanks in advance.

SudKul avatar Mar 28 '21 19:03 SudKul

Any hope to see a fix ? 🙏🏻

xakraz avatar Sep 02 '21 10:09 xakraz

Having this problem when trying to get the ID from commits when PR is merged. The variables used by this action are blank in this context.

As I fix I did the following which gets the ID from the PR's branch:

- uses: atlassian/[email protected]
  id: find_jira_issue
  with:
    string: ${{ github.head_ref }}

You may be able to do the same with commits via string: ${{ github.event.commits.map(c=>c.message).join(' ') }} but I did not test this. :octocat:

sshaw avatar Jan 06 '22 17:01 sshaw

Any hope to see a fix ? 🙏🏻

Ahmed-Salama96 avatar Apr 12 '23 12:04 Ahmed-Salama96