I go the task to pause/unpause a SLA.
My attempt was using Scriptrunner, this way there was no need to develop a complete plugin.
On my development system I got it running.
What I do is, that I get the issue customfield value of the sla I have to pause.
Inside the value is a history list, adding a new pause event there and saving works, pausing the sla without moving to a new status.
I also set the boolean in the ongoing data.
The issue gets an reindex at the ende.
My problem now is, that this works so far only on my development system.
The other two systems I have tested the script wont pause the SLA.
All systems are running the same Jira 8.7.1, Servicedesk 4.7.1 and Scriptrunner 5.6.15.1-p5 versions.
All are running against a Postgres 72
Do you have an idea why the SLA pauses on one but not on a another system?
Thanks for reading this so far
Philipp
I also asked the question here:
https://community.atlassian.com/t5/Jira-Service-Desk-questions/Update-SLA-from-Script/qaq-p/1464744
Found my Answer,
the new Timeline event was created in the future.
Related
For reasons outlined here: https://community.exasol.com/t5/discussion-forum/performance-on-premise-dropping/td-p/9029 we need to restart a database regularly (at least until al issues are resolved, and this can take some time). So the question arises: Can this be done on a regular bases without human interaction?
LUA is not a solution, but perhaps a cron job is possible, but we need OS access for that, which we do not have.
Try to use xmlrpc API: https://github.com/exasol/exaoperation-xmlrpc/blob/master/EXAoperation_XMLRPC.md#method-restartdatabase
Here is a nice example with explanations: https://community.exasol.com/t5/environment-management/starting-and-stopping-clusters-using-xml-rpc/ta-p/1579
Yes, this should be possible using the shudownDatabase() and startDatabase() methods from this GitHub repository. You might need to use stateDatabase() in between to determine when the database is actually stopped before you try to start it again.
I want to do a Jira issue query, but I dont know if it is possible.
I am looking at how many of our bugs have been re-opened ever. So they were worked on, closed, re-opened, and then fixed and closed again. Its a measure of how well bugs are fixed.
That query uses:
AND status was Reopened
However, we have a behaviour where we close an issue, realise that the issue needs editing, so re-open the issue to change the resolution for example, and then close it again.
I think the best way of doing this is to search for something like
'AND status was Reopened for more than 3 hours'
Is there anything like that? The data is there in the history, it is just a matter of weather we can query it or not.
There's no way to write a JQL for issues which were in a status for a given amount of time. JQL only supports searching the time an issue has been in a status relative to a date. If you are using Jira Service Desk, the usual workaround for something like this is to create an SLA for 3 hours which is triggered when the issue moves into the Reopened status, and then query for this SLA being breached.
Otherwise, there are add-ons for adding this functionality to JQL. Or add-ons for creating automations which could set a flag that you could query. Automation for Jira and Scriptrunner are popular plugins that could pull this off, and soon Automation for Jira will be built into Jira Cloud.
Never mind the rationale, I have a case where a build needs to run every 5 minutes. On-premise installation does not support schedules in the YAML.
So, how do we do it? I can probably use the REST Api, but that sucks, because it seems either I create a one-off script or a script for very simple type of schedules. Building a reusable solution, that could be used in general for other builds seems to be involved. So, instead of concentrating on my business I need to go sideways and cover for the deficiencies of the on-premise version of Azure DevOps.
I wonder if there is a better way.
Understand your concern. However, this is not supported at present with on-premise TFS sever.
The UI for defining time-based build triggers isn't flexible enough. It can only support fixed times on days of the week.
Just as you have pointed out in the comment, we have a need to run a build every 5 minutes which requires us to create 288 schedules which is tedious.
Actually, this has already been a user voice.
Scheduled builds - More flexible timing configuration
https://developercommunity.visualstudio.com/idea/365630/scheduled-builds-more-flexible-timing-configuratio.html
Multiple persons commented and echoed. After go through the marketplace, haven't found a pretty appropriate workaround. Sorry for any inconvenience. You could monitor the status of above user voice.
After finishing some task, how is it possible in jira log this current(finish) time?
So I don't want calculate time spending on task as start time of task + time spended on task, I want only enter finish time and time spent will be calculated(in jira) as finish time-start time.
JIRA doesn't currently offer real-time time tracking.
However your IDE should have some means of logging you time - for example Eclipse has this built in in the tasks plugin and it could also be connected to JIRa so that you could see your tasks in the IDE and log your time in "real-time" right there.
I have found this to be rather inconvenient since if inactive inside the IDE for a certain period of time the tracking will stop - this is an option in the IDE though.
I personally use Toggl which is free for a "one-man show" team. Also their pricing for teams is very nice. There are other services like Toggl and they are not all web-based. For example Project Hamster if you're on Linux. Just google time tracking. ;) Otherwise as I said the only way is to connect your IDE to JIRA via some task module.
I'm writing a simple Windows Service that sends out emails to all employees every month. My question is, how to stop itself when it's done? I'm a noobie in this field so please help me out. Really appreciated.
It will be deployed on the server to be run monthly. I did not start this thing and the code was given to me like that. It is written in VB.NET and I'm asked now to change a few things around it. I noticed that there is only 'Sub OnStart' and wondered when the service would stop? After the main sub is done, what it the status of this service? Is it stopped or just hung in there? Sorry, as I said, I am really new to this....
If you have a task that recurs monthly you may be better off writing a console app, and then using Windows Task Scheduler to set it to run monthly. A service should be used for processes that need to run for a long time or constantly, with or without a user logged on
As every other answer has noted, it sounds like this should be an executable or script that you run as a scheduled task.
However, if you are obligated for some reason to run as a Windows Service and you're working in .NET, you just have to call the Stop() method inherited from ServiceBase once your service completes its work. From the MSDN documentation for the method:
The Stop method sets the service state
to indicate a stop is pending and
calls the OnStop method. After the
application is stopped, the service
state is set to stopped. If the
application is a hosted service, the
application domain is unloaded.
There's one important caveat here: the user account under which the service is running must have permission to stop services (which is a topic for ServerFault).
Once a service's OnStart method completes, it will continue running (doing nothing) until something tells it to stop in one of the following ways:
Programatically, by calling Stop
within the service itself or from an
external process using the method
Colin Gravill describes in his
answer.
Via the command-line.
Through the windows Computer Management console's "Services" panel.
If this is a Win32 service (i.e. written in C or C++), then you simply call SetServiceStatus(SERVICE_STOPPED) and return from ServiceMain.
On the other hand, if you're just sending emails once a month, why are you using a service at all? Use the Windows Task Scheduler and run a normal application or script.
net stop [service_name] ...on the command line will do it too.
But, I agree with everyone else; it seems that Windows Task Scheduler will meet your needs better.
It might be better to write this as a scheduled task, it would certainly be easier to develop initially. Then it would naturally terminate and wouldn't be consuming resources for the rest of the month.
To answer the original question, you can get a list of the current running services in C#
services = System.ServiceProcess.ServiceController.GetServices();
Then look for the one you want and set the status to stopped
locatedService.Status == ServiceControllerStatus.Stopped
Full example on msdn
Is there a reason it has to be a Windows service? If not, then follow #Macros solution. However, if it does, then why stop the service? If you stop it, then it'll just have to be restarted when the emails need to be sent. Based on your description, it doesn't sound like it would require a lot of resources, so I'd suggest just installing it and letting it run, firing up once a month to send the emails.
here's what i did in a similar situation.
windows service runs 24/7 and processes work units. it gets work units through a database view.
table Message
ProcessingStartTime
CompletionDTE
...
the database view only pulls records marked not-complete and have a ProcessingStartTime in the past. So after the service confirms the transaction it executes a stored procedure that updates the database record. For this system, end-user upload excel files to asp.net webfrom that imports them into the database.