Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to get the Jira issue ID from the attachment ID

Is there any way we can find out the jira issue id from the attachment id,

We having a public Jira projects for customers and if there is any attachments are added which having sensitive data in it which should not be visible to customer.

Our security team are identifying such attachments and providing the direct links as shown below :

https://i<jira-base-url>/secure/attachment/1234321/server.log?

It does not showing which issue this attachment is belongs to so that Jira admins can update the same.

3 answers

1 accepted

0 votes
Answer accepted

@Abhijeet Kale You can try the below steps to get the issue-key from attachment id

  • Identify the issue-id from the attachment-id from the database
SELECT * FROM fileattachment where id = '12471219'

You will get an issue-id from the query result like below

Capture 2021-06-02 at 15.26.35.png

Then find the issue-key using issue-id, you will get the details as shown in screenshot below

https://<basr-url>/rest/api/2/issue/12929342/

Capture 2021-06-02 at 15.30.43.png

Let me know in case of any issues.

Thanks @Sagar Mahajan I am able to get the issue-key from attachment id from above steps.

Payne Community Leader Jun 08, 2021

If you go this route, use some joins to go ahead and get all the information from the database.

select a.id as attachmentId,concat(p.pkey,'-',issuenum) as issueNum, filename
from fileattachment a
left join jiraissue i on i.id = a.issueid
left join project p on p.id = i.project
where a.id in (30604,26718,30700)

1 vote

There is no way to know what issue a file is attached to from just its id.  The id is a simple unique number which has no relationship to the issue.

Your security team should be looking at attachments visibility by checking the issues, not the direct urls, otherwise they're just wasting your time and theirs.

0 votes
Payne Community Leader Jun 01, 2021

If you have direct database access or a scripting app such as ScriptRunner you could tackle it from that angle.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira Service Management

JSM June Challenge #2: Share how your business teams became ITSM rockstars

For JSM June Challenge #2, share how your non-technical teams like HR, legal, marketing, finance, and beyond started using Jira Service Management! Tell us: Did they ask to start using it or...

322 views 9 7
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you