1

I'm using the jira-python module and was not able to figure out how to retrieve the creation date of a Jira issue link (inwardIssue, outwardIssue)

I looked at https://jira.readthedocs.io/en/master/api.html but could not seem to find what i'm looking for.

For a given issuelink, the Python "dir()" function shows me:

['JIRA_BASE_URL', '_READABLE_IDS', '__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattr__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_base_url', '_default_headers', '_get_url', '_load', '_options', '_parse_raw', '_resource', '_session', 'delete', 'find', 'id', 'inwardIssue', 'outwardIssue', 'raw', 'self', 'type', 'update']

Any pointers would be greatly appreciated.

Thanks

--Andrew

Andrew
  • 147
  • 1
  • 2
  • 8

2 Answers2

1

For a given issue, the creation date is:

issue.fields.created
Martin Serrano
  • 3,727
  • 1
  • 35
  • 48
  • Thanks, but i was asking about the issue LINKS creation date. For example, IssueA "Relates To" IssueB. How do i determine when that link got created? – Andrew Feb 10 '18 at 07:49
0

IssueLink types do not included information about when they were "created" (in this case the moment of linkage and not the creation of said linked issue). This information can be abstracted from an issue's changelog (eg: PROJECT-10):

issue = jira.issue('PROJECT-10', expand='changelog')

for history in issue.changelog.histories:
    for item in history.items:
        if item.field == 'Link':
            print("{} was linked to {} at {}".format(item.toString.split()[-1], issue, history.created))