NightWish


  • Home

  • Categories

  • About

  • Archives

  • Tags

How to create recurring tasks and automatically update task status

Posted on 2022-11-12 | In Notion | Visitors

Background

We introduced how to improve your work efficiency by Notion daily tasks in last artical,Meanwhile,we find two issues as below:

  1. Notion is unable to support recurring tasks,For example,daily review,daily meeting .
  2. you need manually update CompletedDate for Notion tasks, If not, You will still see the tasks that already completed yesterday.

Requirements

  1. Recurring tasks
Requirement
Create template page for recurring tasks and create recurring tasks in this template page
Query recurring tasks in template page, Create different recurring tasks by different recurring task types,For example, Homework review is workday task , Nucleic acid testing is weekly taskk, and some tasks only occurs on specific days(Monday,Thursday etc)
  1. Automatically update task status
Requirement
Task is already expired ,We need to complete this task ASAP,So mark this task as Doing Status to complete this task today
If task will be expired in X days(X shouldn’t be empty or 0),We’d better to mark task status as Todo to avoid forgetting to complete this task
If task will be expired today,Mark task as Doing status
If task expiration date is within date range,Mark task as Doing status
If you forgot to input expiration date for your task yesterday , Update task expirationDate to the date of yesterday,Mark task status as Todo
If task is completed(Task status is Done),Update CompletedDate to the date of yesterday,This task will not show in your daily task board
Read more »

Automatically create Daily Notion Tasks by windows task scheduler

Posted on 2022-10-01 | In Notion | Visitors

We introduced how to automatically create daily automation by Jenkins In last artical http://nightwish.tech/2022/10/01/DailyTaskCreationByJenkins ,If you wouldn’t like to install jenkins in your laptop. you could automatically call python package to create your daily Notion task by windows task scheduler.

Steps:

  1. Install Python https://www.python.org/downloads/ ,Python version>3.9

  2. Download NotionRecurringTask project from github nightwish2016/NotionRecurringTask (github.com)

Read more »

Automatically create Daily Notion Tasks by Jenkins

Posted on 2022-10-01 | In Notion | Visitors

We already introduced how to create daily Notion tasks By Azure function in last article 创建重复性的Notion任务以及自动更新任务状态 | NightWish. I will introduce how to automatically create Daily Notion tasks and update Notion tasks status in case you are unable to access Azure .

Jenkins setup:

  1. Install Jenkins by Docker, please refer my article Docker 持续部署hexo blog到github page上和云虚拟机上 | NightWish

  2. Create a Jenkins project

Read more »

创建重复性的Notion任务以及自动更新任务状态

Posted on 2022-09-25 | In Notion | Visitors

背景

在上一篇的文章中,我介绍了如何通过Notion创建Daily task来提升工作效率,但是也发现了2个问题。

  1. Notion不支持创建循环任务,比如每天都需要创建的Daily Wrike,Daily review等task

  2. 如果任务已经完成需要手动设置CompletedDate,否则已经Done的任务也会显示在第二天的看板里

需求

  1. 循环任务需求
Requirement
创建一个循环任务模板page,并且建立好对应的循环任务
查询循环任务模板,根据任务的循环类型,创建不同的Daily task,例如 task daily wrike是每日都要做的,娃跳舞是每个周日的task
  1. 自动更新任务状态
Requirement Comment
如果一个task是TBD或者空状态,并且task过期时间小于等于今天,那么标记task为Doing状态 已经过期或者今天即将要期的task,但是目前还没做,需要当天立即去做,所以放到doing组里今天需要马上去做
如果一个task是TBD或者空状态,并且Task 将在X天内过期(设置了提前X天过期提醒,X不为空或者0),那么提前X天标记task为Todo状态 X天内即将到期的task,需要尽快完成,所以放到Todo 组下面,防止忘记
如果一个task是TBD或者空状态,并且Task 将在X天内过期(未设置提前X天过期提醒,X为空或者0),那么直到task过期的那天设置tas为Doing状态 已经到期的task需要马上去做,所以设置task为Doing状态
如果一个task是TBD或者空状态,并且当天的时间在过期时间段之内,那么标记task为Doing状态 Task已经到了开始做的时间,需要马上开始做,所以放到doing组里去马上做
如果task过期时间是空,那么更新过期时间是今天,并且标记task状态为ToDo 创建任务的时候忘记标记过期时间,默认当天需要完成该task
如果task为Done状态,那么自动填充CompletedDate 只有completedDate<当前时间,并且状态为Done, 第二天的daily task才不会显示在看板里
Read more »

如何使用Notion创建管理Daily tasks

Posted on 2022-09-24 | In Notion | Visitors

背景:

因为每日的工作生活中有很多待办事项经常会超过20项,如果全部依赖大脑记忆,容易遗漏事项。通过传统的记事本,便利贴都无法快速有效管理task,期间也尝试了excel,oneNote,Microsofer todo 等软件去管理task,都无法很好的满足我的需求。 如何有效的管理每日的待办事项对于我个人来说就是件比较迫切的事情, 一次偶然的机会发现Notion具有强大的文档以及task管理能力,Notion对于创建Daily task的看板对于工作生活还是很有帮助的。 最后的效果图如下图,如果对这个Daily task page 感兴趣,请在Notion中Duplicate这个page Daily Task pic1

Notion介绍

Notion 是一款将笔记、知识库和任务管理整合的协作工具。 个人比较喜欢里面的database 功能,可以很方便的管理你的笔记,To Do list等.Notion支持web,手机APP,电脑端APP访问

适合群体

长期使用电脑工作,每天的各项任务数大于15项左右的群体

Notion Daily Task 设置步骤:

  1. 点击左侧导航的+,创建一个空page,取名daily tasks
    pic2
Read more »

Export test Data to Excel by Pandas

Posted on 2021-12-19 | In Python | Visitors
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
def generateTestDataFile(path,testData_list):
df=pd.DataFrame(testData_list)
df_testdata=df[df['TransactionType'].isin(['NewCard Sale','MoneyPak Sale', 'GDC SwipeReload','GDC Unload','GDN SwipeReload'])]
df_pinkey=df_testdata.filter(items=["PartnerName","TransactionType",'Pinkey'])
df_pinkey=df_pinkey.loc[df_pinkey["Pinkey"]!=""]
df_ls=[]
writer = pd.ExcelWriter(path)
df_testdata.to_excel(writer, sheet_name='TestData', index=False)
df_pinkey.to_excel(writer, sheet_name='Pinkey', index=False)
for column in df_testdata:
column_length = max(df_testdata[column].astype(str).map(len).max(), len(column))
col_idx = df_testdata.columns.get_loc(column)
writer.sheets['TestData'].set_column(col_idx, col_idx, column_length)
for column in df_pinkey:
column_length = max(df_pinkey[column].astype(str).map(len).max(), len(column))
col_idx = df_pinkey.columns.get_loc(column)
writer.sheets['Pinkey'].set_column(col_idx, col_idx, column_length)
writer.save()

Call Splunk API to check logs

Posted on 2021-12-19 | In Python | Visitors
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
from requests.auth import HTTPBasicAuth
import json, pprint
import requests
from TestRailUtil import JSONObject
from types import SimpleNamespace
from datetime import datetime


123
base_url = 'https://xxxx:8089'
username = 'xxx'
password = 'xxx'
12345

date1 = datetime.now()
print(date1)

search_query2 = "search=search RetailerTransID=\"XXX\" sourcetype=XXX host=PRODSQL earliest=-10d"
url= base_url+"/services/search/jobs/export?output_mode=raw"
r = requests.post(url, data=search_query2, auth=HTTPBasicAuth(username, password),
# headers = { 'Content-Type': 'application/json'},
verify = False)
date2 = datetime.now()
print(date2)
durating=date2-date1
print(r.status_code)
print(durating)

print(r.text) # if not found r.text==""
dic=dict()
index=r.text.index("retailersaleskey")
data_ls=r.text[index:].split(',')
for data in data_ls:
key=data.split("=")[0].strip()
value=data.split("=")[1].strip().replace("\"","")
dic[key]=value
retailersalesObj=json.loads(json.dumps(dic),object_hook=JSONObject)
print(retailersalesObj.retailersaleskey)
print(retailersalesObj.RetailerTransID)


Call Splunk API to check logs

Posted on 2021-12-19 | In Python | Visitors
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
from requests.auth import HTTPBasicAuth
import json, pprint
import requests
from TestRailUtil import JSONObject
from types import SimpleNamespace
from datetime import datetime



base_url = 'https://xxxx:8089'
username = 'xxx'
password = 'xxx'


date1 = datetime.now()
print(date1)

search_query2 = "search=search RetailerTransID=\"XXX\" sourcetype=XXX host=PRODSQL earliest=-10d"
url= base_url+"/services/search/jobs/export?output_mode=raw"
r = requests.post(url, data=search_query2, auth=HTTPBasicAuth(username, password),
# headers = { 'Content-Type': 'application/json'},
verify = False)
date2 = datetime.now()
print(date2)
durating=date2-date1
print(r.status_code)
print(durating)

print(r.text) # if not found r.text==""
dic=dict()
index=r.text.index("retailersaleskey")
data_ls=r.text[index:].split(',')
for data in data_ls:
key=data.split("=")[0].strip()
value=data.split("=")[1].strip().replace("\"","")
dic[key]=value
retailersalesObj=json.loads(json.dumps(dic),object_hook=JSONObject)
print(retailersalesObj.retailersaleskey)
print(retailersalesObj.RetailerTransID)


Run Python command with parameters

Posted on 2021-04-07 | In Python | Visitors

Note:Pass parameters in Command line

prodDBValidation.py

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
from DBJsonGeneration import DBJsonGeneration

from DBValidation import DBValidation

from termcolor import colored, cprint

import colorama

import argparse

colorama.init()


def process(planName,projectName):

g=DBJsonGeneration()

entryList=g.getDBJsonFromTestRail(planName.strip(),projectName.strip())

d=DBValidation()

d.verifyDB(entryList)



parser = argparse.ArgumentParser(description='Production DB validation')

parser.add_argument('--planName', '-plan', help='planName must be necessarily parameter', required=True)

parser.add_argument('--projectName', '-project', help='projectName must be necessarily parameter', required=True)

args = parser.parse_args()



if __name__ == "__main__":

process(args.planName,args.projectName)

print("***Done***")

Run command line:

1
>f:\jenkins_workspace\workspace\XXX\TransactionValidation\Scripts\python f:\jenkins_workspace\workspace\XXX\TransactionValidation\src\prodDBValidation.py -plan  plan123 -project projectName

Run python application tool by Jenkins

Posted on 2021-04-07 | In Jenkins | Visitors

Note: Run python application tool by Jenkins

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# powershell script
#(Get-Host).Version
$Workspace=$env:Workspace
#Write-Host $env:Workspace
#Write-Host $Workspace
Write-Host "****Update file attribute to not ReadOnly for pyvenv.cfg*****"
sp $Workspace\QA\Nigthwish\TransactionValidation\pyvenv.cfg IsReadOnly $false
Write-Host "****Update content for pyvenv.cfg*****"
(Get-ItemProperty $Workspace\QA\Nigthwish\TransactionValidatio\pyvenv.cfg).IsReadOnly
$content="home = $Workspace\QA\Nigthwish\DBValidation\Python-3.7.1`ninclude-system-site-packages = false`nversion = 3.7.1"
#Write-Host "content:"$content
$filename="$Workspace\QA\Nigthwish\TransactionValidation\pyvenv.cfg"
#Write-Host "filename:"$filename
$Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False
[IO.File]::WriteAllLines($filename, $content, $Utf8NoBomEncoding)
#Get-Content $Workspace \QA\Nigthwish\TransactionValidatio\pyvenv.cfg
Write-Host "****pyvenv.cfg update is completed*****"
1
2
3
:: this is a windows command
::more %Workspace%\QA\Nigthwish\TransactionValidation\pyvenv.cfg
%Workspace%\QA\Nigthwish\TransactionValidation\Scripts\python %Workspace%\QA\Nigthwish\TransactionValidatio\src\prodDBValidation.py -plan %PLANN_NAME% -project %TESTRAIL_PROJECT%
123<i class="fa fa-angle-right"></i>

28 posts
8 categories
10 tags
GitHub E-Mail
© 2023 Kevin Zhou
Powered by Hexo
Theme - NexT.Pisces