Hide/Snooze issues in YouTrack - youtrack

I want to use YouTrack for Key-Account-Management.
There is one Epic and for each key account (customer) one sub-issue.
I want to talk to each key account roughly every 6 months.
Is there a way to hide or snooze an issue for some time.
The issue should be like resolved for some months, and then come back if the snooze time has expired.
How to do this with youtrack?

The issue should be like resolved for some months
It seems that one can simply resolve the issue to accomplish it.
The tricky part is to reopen them automatically in 6 months. The following workflow rule can reopen YouTrack issues by timer:
var entities = require('#jetbrains/youtrack-scripting-api/entities');
var workflow = require('#jetbrains/youtrack-scripting-api/workflow');
exports.rule = entities.Issue.onSchedule({
title: workflow.i18n('Reopen issues in 6 months'),
search: '#Resolved', // Narrow the search to specify which issues are affected
cron: '0 0 0 ? * * *', // Fires once a day
guard: function(ctx) {
// If an issue was in a resolved state for half a year already...
return Date.now() - ctx.issue.resolved < 15552000000;
},
action: function(ctx) {
// ... then reopen it
ctx.issue.State = ctx.State.Open;
},
requirements: {
State: {
type: entities.State.fieldType,
Open: {}
}
}
});

Related

Expo Calendar Creating and Tracking Events

I am having a seriously tough time figuring out how to effectively manage events created with .createEventAsync() method in expo-calendar API. Docs found here. This is the structure of the parameter I am entering into .createEventAsync().
testEvent = {
calendarId: calendarId,
title: event.position,
startDate: shiftStart,
endDate: shiftEnd,
location: event.store.name,
alarms: [],
id: event.id,
}
The idea is to have the event id on the app calendar be the same as the id on the OS calendar, but it seems like that is not possible. I am trying to build a system that requests permissions, if permissions granted then sync all events on the app with the os calendar. If the event already exists, do not create another event.
The function runs a check with:
async function checkEventExists(eventId: any) {
try {
const event = await Calendar.getEventAsync(eventId)
console.log(console.log(event))
if (event) {
return true
}
} catch {
return false
}
}
If false, event is not created. If true then .createEventAsync() is called.
Currently, new instances of the same event are created every time the app polls data from the server and this is unrelated, but also creates 7 instances of 1 event each time data is polled. How do people usually manage and track calendar events after creation? I thought event id would be a good way to tell if the event is one and the same, but I was wrong.

Send Mail to a user if count of open issues greater a specific limit

how could i create a workflow which on every change of the current issue user checks the total amount of open issues for this user and if the amount is greater then lets say 5 the user gets a mail with a little warning message?
I guess this here is close to my topic, but only close:
https://youtrack-support.jetbrains.com/hc/en-us/community/posts/206582955-How-to-count-user-s-issues-
All our users have a mail in youtrack, the workflow should only work for one usergroup/project however.
Thank you and best regards
The How to count user's issues? illustrates the approach that valid for old workflow.
For the new JavaScript workflow, I suggest you use the search method for getting all open issues assigned to the required user. Then, you can use the user.notify method to send an email to this user.
You can find common information about JavaScript workflow in the JavaScript Workflow Quick Start Guide article. I hope this helps.
Here is an example that illustrates how to send a message with the assigned issues count to the user:
var entities = require('#jetbrains/youtrack-scripting-api/entities');
var search = require('#jetbrains/youtrack-scripting-api/search');
exports.rule = entities.Issue.onChange({
title: 'Assignee count',
guard: function(ctx) {
return ctx.issue.isChanged(ctx.Assignee) && ctx.issue.fields.Assignee;
},
action: function(ctx) {
var issue = ctx.issue;
var user = issue.fields.Assignee;
var query = 'for: ' + user.login + ' #Unresolved';
var assignedToUser = search.search(issue.project, query, ctx.currentUser);
var count = assignedToUser.size;
var subj = 'Attention!';
var body = 'You have ' + count + ' assigned issues';
user.notify(subj, body);
},
requirements: {
Assignee: {
type: entities.User.fieldType
}
}
});

Update data when value changes Vue Js

I have quite a complicated situation and i'm not amazing at Vue so I need some help.
I have a Firebase DB that gets an array (clients) and displays it.
const clientsRef = db.ref('clients')
firebase: {
clients: {
source: clientsRef,
//data has been retrieved from firebase
readyCallback: function() {
this.getSiteCount() // Get number of sites associated with client
this.loaded = true // Hide loader bar once this becomes true
}
}
},
On load complete getSiteCount() will get the clients unique ID and compare it against the sites DB and count how many exist. Below code simply loops around each client and then checks how many sites have the client_id of aClient['.key']. Not really important this works and gets the count and adds it to the clients array.
getSiteCount: function() {
this.clients.forEach((server, clientIndex) => {
this.clients[clientIndex].siteCount= 0
serverContactsRef.orderByChild('client_id').equalTo(server['.key']).on('child_added', (clientDetails) => {
this.clients[clientIndex].siteCount= this.clients[clientIndex].siteCount+ 1
})
})
},
Now in my html I have v-for="clients in filterClients" and the computed function...
filterClients: function() {
function compare(a, b) {
if (a.siteCount < b.siteCount) {
return 1
}
if (a.siteCount > b.siteCount) {
return -1
}
return 0
}
return this.clients.sort(compare)
}
I suspect because the getSiteCount() function runs once the clients have been pulled (0.5s delay) from the DB it's initial siteCount value is 0 and filterClients runs before those values get set. I need to delay filterClients() until the getSiteCount() function runs or need it to update automatically when the getSiteCount() function runs.
Can someone help me make sure the initial load of the page displays the clients in order of how many sites it has (siteCount)
It was in fact a Caveat.
Vue cannot detect the following changes to an array:
When you directly set an item with the index, e.g. vm.items[indexOfItem] = newValue
I changed
this.clients[clientIndex].siteCount= 0
to
Vue.set(this.clients[clientIndex], 'contractsNr', 0)
Updates when the data comes in perfectly now.
Thanks Jacob

Oracle Apex Dynamic actions in tabular form

I am developing an app that captures the every day resource utilization of a person in a team.
I completed every thing and stuck up at a point i.e
Please find the below link for the image (I cant upload image here as I am a new user)
http://s17.postimg.org/qgh6559rj/image.jpg
As shown in the above image I created a Tabular form for this where month is a drop down list and year is a text box, the days 1,2,3,....31 are text boxes to capture utilized time.
My requirement is to make the days greyed out and lock (not to allow the user to enter data) for the days which are not in that month.
ex: when Month : Feb then 29,30,31 : greyed out and locked
I have searched in many websites for the solution, But I couldn't get one.
Hi Aditya,
I tried to solve this problem.I created similar tabular form having colmns like day1,day2...Day29,Day30,Day31.Here I have focused on only day29,Day30,Day31 as because only these columns will get affect on change of year. Rather than dynamic action I have called JavaScript function hideShow() on change of year
Following is code for hideShow where as f04,f05,f06 are day29,day30,day31.
In this function I also added possibility of leap year
function hideShow(pThis)
{
var month=$(pThis).closest('tr').find('[name="f02"]').val();
var year=$(pThis).val();
if (Boolean(parseInt(year) % 4 == 0)&&Boolean(parseInt(year) % 100 != 0)||Boolean(parseInt(year) % 400 == 0)) {
if (month.trim()=='FEB') {
$(pThis).closest('tr').find('[name="f05"]').attr("disabled","disabled");
$(pThis).closest('tr').find('[name="f06"]').attr("disabled","disabled");
}
}
else {
if (month.trim()=='FEB') {
$(pThis).closest('tr').find('[name="f04"]').attr("disabled","disabled");
$(pThis).closest('tr').find('[name="f05"]').attr("disabled","disabled");
$(pThis).closest('tr').find('[name="f06"]').attr("disabled","disabled");
}
}
if(month.trim()=='APR') {
$(pThis).closest('tr').find('[name="f06"]').attr("disabled","disabled");
}
else if(month.trim()=='JUN') {
$(pThis).closest('tr').find('[name="f06"]').attr("disabled","disabled");
}
else if(month.trim()=='SEP') {
$(pThis).closest('tr').find('[name="f06"]').attr("disabled","disabled");
}
else if(month.trim()=='JAN'||month.trim()=='MAR'||month.trim()=='MAY'||month.trim()=='JUL'||month.trim()=='AUG') {
$(pThis).closest('tr').find('[name="f04"]').attr("disabled",false);
$(pThis).closest('tr').find('[name="f05"]').attr("disabled",false);
$(pThis).closest('tr').find('[name="f06"]').attr("disabled",false);
}
}
Here I only worked with disable/enable, similarly it is also possible to apply css runtime, Hope this code will help you...

Rails 3 Full Calendar- unable to update events

Relatively new to Jquery and Rails 3. I have implemented full calendar into my site and all works ok apart from actually updating my Events model via the full calendar interface. From what iunderstand I should be able to drag and drop a calendar entry to another day and it will update the Events model and leave the appointment in its new day upon a refresh. This however does not happen. has anyone had similar issues with this? the code for this action looks like this
function updateEvent(the_event) {
$.update(
"/events/" + the_event.id,
{ event: { title: the_event.title,
starts_at: "" + the_event.start,
ends_at: "" + the_event.end,
description: the_event.description
}
},
function (reponse) { alert('successfully updated task.'); }
);
};
Am I missing something obvious?
I had a problem with editing events in the fullCalendar plugin. In my case it had to do with the parameters editable and disableResizing. You have to implement the eventDrop handler for the drag and drop functionality. The parameters dayDelta, minuteDelta, allDay contain the time difference between old and new date:
$('#calendar').fullCalendar({
...
editable: true,
eventDrop: function(event,dayDelta,minuteDelta,allDay,revertFunc) {
$.ajax({
type:"PUT",
url: "/events/"+event.id,
data: "minute_delta="+minuteDelta+"&day_delta="+dayDelta,
..
});
}
});