| |
@@ -710,25 +710,40 @@
|
| |
"""
|
| |
# Update the issue status in the JIRA description
|
| |
# Format the status
|
| |
- today = datetime.today()
|
| |
- formatted_status = "[%s] Upstream issue status: %s" % (
|
| |
- today.strftime("%a %b %y"), issue.status)
|
| |
+ formatted_status = "Upstream issue status: %s" % issue.status
|
| |
new_description = existing.fields.description
|
| |
+ # Bool to indicate if we should update
|
| |
+ update = False
|
| |
# Check if the issue has the issue status line
|
| |
+ # First check legacy upstream status so we can update them
|
| |
if "] Upstream issue status:" in existing.fields.description:
|
| |
# Use pattern matching to find and update the status
|
| |
new_description = re.sub(
|
| |
r"\[.*\] Upstream issue status: .*",
|
| |
formatted_status,
|
| |
new_description)
|
| |
+ update = True
|
| |
+ # Now check if the status is already present
|
| |
+ elif formatted_status in existing.fields.description:
|
| |
+ pass
|
| |
+ # Then check for upstream status
|
| |
+ elif "Upstream issue status:" in existing.fields.description:
|
| |
+ # Use pattern matching to find and update the status
|
| |
+ new_description = re.sub(
|
| |
+ r"Upstream issue status: .*",
|
| |
+ formatted_status,
|
| |
+ new_description)
|
| |
+ update = True
|
| |
else:
|
| |
# We can just add this line to the very top
|
| |
new_description = formatted_status + '\n' + new_description
|
| |
- # Now we can update the JIRA issue (always need to update this
|
| |
- # as there is a timestamp involved)
|
| |
- data = {'description': new_description}
|
| |
- existing.update(data)
|
| |
- log.info(' Updated transition')
|
| |
+ update = True
|
| |
+ if update:
|
| |
+ # Now we can update the JIRA issue (always need to update this
|
| |
+ # as there is a timestamp involved)
|
| |
+ data = {'description': new_description}
|
| |
+ existing.update(data)
|
| |
+ log.info(' Updated transition')
|
| |
|
| |
# If the user just inputted True, only update the description
|
| |
# If the user added a custom closed status, attempt to close the
|
| |
Removing date from upstream status in JIRA
[Wed Sep 15] Upstream Issue Status: Open
->Upstream Issue Status: Open