How to prevent duplication of JIRA Tickets in python - jira

I have 2 instances of JIRA . I have written a script where tickets from one instance are read and a replicas of same are created in another instance.
Now the problem is , whenever I run the script it is generating duplicate tickets again and again.
How do I prevent this duplication of tickets? Please help.

Ideas:
Create a link field in each Jira issue and populate it. If the field is populated the script should not create a new issue
Use a "last synced" field in the source Jira and only create a new issue if the source issue has not been synced
You don't say but I assumed that this is a one way sync

Related

jira bulk update custom field value

I need to update all the values of a custom field in Jira. I noticed the "Bulk Fix Resolutions" script which is kind of what I want, but not for resolutions, for custom field value. Any thoughts on what I need to do?
A groovy script run in the ScriptRunner console. Carefully tested in staging beforehand. Or an external script such as jira-python
Thanks I found the answer here, it can be done with existing UI:
Using the bulk change wizard - The bulk change wizard will progress you through your bulk change. To step back at any step of the operation, select the relevant step in the menu on the left-hand side. Selecting Cancel will cancel the entire process.
https://confluence.atlassian.com/jiracoreserver074/editing-multiple-issues-at-the-same-time-921047221.html?_ga=2.18023408.858755321.1517851422-336306238.1516208522

Is there a way to automatically import issues from Jira into Taiga?

Just started using Taiga.io, and was wondering if there was a way to auto-import issues/stories so I don't have to manually rewrite them.
You could make some sort of sync program/script that pulls from a JIRA project into a Tangia project.
Example. Have a file that contains the latest JIRA issue key that exists within Taiga and then the script runs every hour. Upon execution it does a REST call to get any issues above that JIRA key (Ex. TEST-5):
/rest/api/2/search?jql=key%20>%20TEST-5%20order%20by%20key%20desc
Then it updates the file with the highest key value and then pushes each issue into Taiga which can be done using the Taiga REST API.
Additionally you may be able to do something with the JIRA Workflow so that when issues are created something occurs within the workflow that calls the Taiga REST API and creates the task automatically.
Just save them in a format recognized by both Jira and Taiga than each time the file changes you just import it to Taiga (I used csv Excel and it worked pretty fine). The only downside is that you need to stay loggedin 24/7 if you work with worldwide distributed teams in order for the auto-function to work...

Auto assign to team lead/developer on bug reopen

In my implementation of JIRA, I have a custom field called Developer which gets populated automatically (username) whenever someone move the JIRA from Open to Fixed state. Now I want something similar for the Fixed to Reopen transition. That is, whenever the tester changes the status to Reopen, it should go back to the Developer or the Project Lead (in case the field isnt populated as the custom field can be overridden).
I tried to implement a post function, but there isn't a way where I can use OR criteria. Or is there a way?
You can do a Post Function on the transition using the Script Runner plugin if its a self-hosted JIRA instance which will allow you great flexibility in the logic to fill the target field in.
I finally managed to find a workaround for this.
Download the Workflow Enhancer for JIRA plugin (FREE). You would also need JIRA Suite Utilities (I had it installed already for some other customization)
In the Fixed to Reopen transition, add a Post Function and use Copy Value From Other Field to update Assignee from Developer field
Then add another Post Function underneath this where you need to use Universal Post Function. Here make the boolean condition as {Assignee}=="" and select Choose post function to execute: as Assign to Lead Developer
Publish the draft.

Renaming JIRA Issues

Is it possible to rename an issue for a given project in JIRA?
For example, if I have a project named equities and I create an issue from the JIRA GUI, the new issue is named something like equities-1.
Could I rename the issue to something like equities_1.0.0?
I am trying to create a release management workflow in JIRA and need to enforce strict naming conventions. Hence, why I need to change the name.
Sorry but you can't.
What you are calling a "name" is indeed a key automatically generated by JIRA :
[PROJECT_KEY]-[SEQUENCE_NUMBER].
You can never change it.
For your release management workflow, I think you should try another field :
"summary" field,
or why not a brand new custom field,
or use the "fix_version" field
I hope it helps

Is it possible to show all the submits from a Perforce depot without having to select a job?

We are currently attempting to setup an instance of Jenkins as our build system for our code base. We have multiple jobs setup (all using the same depot) to build different sections of the code.
We would now like to show the submits from all users pertaining to this depot on the main Jenkins screen rather than being able to view the change lists involved with a certain build (e.g. by selecting a certain job and then the link leading to the build information, etc...). I've looked into possible plugins and the closest one I was able to find was the "All Changes Plugin". This is exactly what we would like, but this is only visible when viewing the details of a build (e.g. which CLs were used to create the build), but would it be possible to show this type of information on the main Jenkins page instead?
Thank you in advance for your help.
You could write an extension for the Dashboard View plugin to provide a portlet containing an aggregated list of changes from perforce, though if you aren't experienced with writing plugins then you might be better off using a separate repository browser such as Fisheye or P4Web to display your changes.

Resources